Honor email mfa setting
This commit is contained in:
parent
87e8165346
commit
6f36515a3a
|
@ -28,12 +28,11 @@ export default function Login(props: LoginProps) {
|
|||
addLocalLog(
|
||||
() => ` srpAttributes: ${JSON.stringify(srpAttributes)}`
|
||||
);
|
||||
if (!srpAttributes) {
|
||||
setUserSRPSetupPending(true);
|
||||
setUserSRPSetupPending(!srpAttributes);
|
||||
if (!srpAttributes || srpAttributes.isEmailMFAEnabled) {
|
||||
await sendOtt(email);
|
||||
router.push(PAGES.VERIFY);
|
||||
} else {
|
||||
setUserSRPSetupPending(false);
|
||||
setData(LS_KEYS.SRP_ATTRIBUTES, srpAttributes);
|
||||
router.push(PAGES.CREDENTIALS);
|
||||
}
|
||||
|
|
|
@ -531,7 +531,9 @@ export async function getDisableCFUploadProxyFlag(): Promise<boolean> {
|
|||
}
|
||||
}
|
||||
|
||||
export const getSRPAttributes = async (email: string) => {
|
||||
export const getSRPAttributes = async (
|
||||
email: string
|
||||
): Promise<SRPAttributes | null> => {
|
||||
try {
|
||||
const resp = await HTTPService.get(`${ENDPOINT}/users/srp/attributes`, {
|
||||
email,
|
||||
|
|
|
@ -122,6 +122,7 @@ export interface SRPAttributes {
|
|||
memLimit: number;
|
||||
opsLimit: number;
|
||||
kekSalt: string;
|
||||
isEmailMFAEnabled: boolean;
|
||||
}
|
||||
|
||||
export interface GetSRPAttributesResponse {
|
||||
|
|
Loading…
Reference in a new issue