Interface UseLoginValue

Hierarchy

  • UseLoginValue

Properties

clearForgotPasswordError: (() => void)

Type declaration

    • (): void
    • Set forgotPasswordError back to null.

      Returns void

clearLoginError: (() => void)

Type declaration

    • (): void
    • Set loginError back to null.

      Returns void

codeValidation: {
    isInvalid: boolean;
}

Type declaration

  • isInvalid: boolean

    true if the code argument is invalid.

forgotPasswordError: null | Error

Set if an error occurs while processing sendForgotPasswordCode() or resetForgottenPassword().

hasSentForgotPasswordCode: boolean

true if the forgot password code has been successfully sent to the user.

hideForgotPassword: (() => void)

Type declaration

    • (): void
    • Set isShowingForgotPassword to false.

      Returns void

isLoggingIn: boolean

true while processing loginWithUsernamePassword().

isMfaCodeRequired: boolean

true if the user logged in using MFA and a code is required to finish the login attempt. Prompt the user for a code and call submitMfaCode().

isPasswordTemporary: boolean

true if the user logged in using a temporary password. Prompt the user for a new password and call resetTemporaryPassword().

isResettingForgottenPassword: boolean

true while processing resetForgottenPassword().

isResettingTemporaryPassword: boolean

true while processing resetTemporaryPassword().

isSendingForgotPasswordCode: boolean

true while processing sendForgotPasswordCode().

isShowingForgotPassword: boolean

true when showing the forgot password flow.

isSubmittingMfaCode: boolean

true while processing submitMfaCode().

loginError: null | Error

Set if an error occurs while processing loginWithUsernamePassword() or resetTemporaryPassword().

loginWithGoogle: (() => void)

Type declaration

    • (): void
    • Open redirect user to the Google sign-in page.

      Returns void

loginWithUsernamePassword: (() => void)

Type declaration

    • (): void
    • Attempt to use the username and password arguments to create a session. Will call onLogin() if successful, otherwise will set loginError.

      Returns void

newPasswordConfirmedValidation: {
    isInvalid: boolean;
}

Type declaration

  • isInvalid: boolean

    true if the newPasswordConfirmed argument is invalid (must match the newPassword argument).

newPasswordValidation: {
    hasLowercaseLetter: boolean;
    hasMinLength: boolean;
    hasNumber: boolean;
    hasSpecialCharacter: boolean;
    hasUpperCaseLetter: boolean;
    isInvalid: boolean;
}

Type declaration

  • hasLowercaseLetter: boolean

    true if the newPassword argument has a lowercase letter (required to be valid).

  • hasMinLength: boolean

    true if the newPassword argument has at least the minimum number of characters (required to be valid).

  • hasNumber: boolean

    true if the newPassword argument has a number (required to be valid).

  • hasSpecialCharacter: boolean

    true if the newPassword argument has a special character (required to be valid).

  • hasUpperCaseLetter: boolean

    true if the newPassword argument has an uppercase letter (required to be valid).

  • isInvalid: boolean

    true if the newPassword argument is invalid.

passwordValidation: {
    isInvalid: boolean;
}

Type declaration

  • isInvalid: boolean

    true if the password argument is invalid.

resetForgottenPassword: (() => void)

Type declaration

    • (): void
    • Attempt to use the code, newPassword, and newPasswordConfirmed arguments to reset the user's password. A failed request will set forgotPasswordError.

      Returns void

resetTemporaryPassword: (() => void)

Type declaration

    • (): void
    • Attempt to use newPassword and newPasswordConfirmed arguments to reset the user's password and create a session. Will call onLogin() if successful, otherwise will set loginError.

      Returns void

sendForgotPasswordCode: (() => void)

Type declaration

    • (): void
    • Attempt to use the username argument to start the forgot password process. This will send the user an email with a code to enter. A failed request will set forgotPasswordError.

      Returns void

showForgotPassword: (() => void)

Type declaration

    • (): void
    • Set isShowingForgotPassword to true.

      Returns void

submitMfaCode: (() => void)

Type declaration

    • (): void
    • Attempt to use code argument to submit the MFA code and create a session. Will call onLogin() if successful, otherwise will set loginError.

      Returns void

usernameValidation: {
    isInvalid: boolean;
}

Type declaration

  • isInvalid: boolean

    true if the username argument is invalid.