Add orgId to reuse login1/login2 logic for LDAP 2nd step login

This commit is contained in:
Tuan Dang
2024-02-26 10:41:44 -08:00
parent 1c088b3a58
commit 9ba4b939a4
8 changed files with 40 additions and 10 deletions
@@ -21,10 +21,12 @@ interface IsLoginSuccessful {
*/
const attemptLogin = async ({
email,
orgId,
password,
providerAuthToken
}: {
email: string;
orgId?: string;
password: string;
providerAuthToken?: string;
}): Promise<IsLoginSuccessful> => {
@@ -38,6 +40,7 @@ const attemptLogin = async ({
const { serverPublicKey, salt } = await login1({
email,
orgId,
clientPublicKey,
providerAuthToken
});
@@ -59,6 +62,7 @@ const attemptLogin = async ({
tag
} = await login2({
email,
orgId,
clientProof,
providerAuthToken
});
+2
View File
@@ -25,12 +25,14 @@ export type VerifyMfaTokenRes = {
export type Login1DTO = {
email: string;
orgId?: string;
clientPublicKey: string;
providerAuthToken?: string;
}
export type Login2DTO = {
email: string;
orgId?: string;
clientProof: string;
providerAuthToken?: string;
}
@@ -78,6 +78,7 @@ export const PasswordStep = ({
} else {
const loginAttempt = await attemptLogin({
email,
orgId: organizationId,
password,
providerAuthToken,
});