Options
All
  • Public
  • Public/Protected
  • All
Menu

Module recipe/emailverification

Index

References

Re-exports RecipeFunctionOptions

Type Aliases

PostAPIHookContext: RecipePreAPIHookContext<PreAndPostAPIHookAction>
PreAPIHookContext: RecipePreAPIHookContext<PreAndPostAPIHookAction>
RecipeInterface: { getEmailVerificationTokenFromURL: any; getTenantIdFromURL: any; isEmailVerified: any; sendVerificationEmail: any; verifyEmail: any }

Type declaration

  • getEmailVerificationTokenFromURL:function
    • getEmailVerificationTokenFromURL(input: { userContext: any }): string
    • Reads and returns the email verification token from the current URL

      Parameters

      • input: { userContext: any }
        • userContext: any

      Returns string

      The "token" query parameter from the current location

  • getTenantIdFromURL:function
    • getTenantIdFromURL(input: { userContext: any }): undefined | string
    • Reads and returns the tenant id from the current URL

      Parameters

      • input: { userContext: any }
        • userContext: any

      Returns undefined | string

      The "tenantId" query parameter from the current location

  • isEmailVerified:function
    • isEmailVerified(input: { options?: RecipeFunctionOptions; userContext: any }): Promise<{ fetchResponse: Response; isVerified: boolean; status: "OK" }>
  • sendVerificationEmail:function
    • sendVerificationEmail(input: { options?: RecipeFunctionOptions; userContext: any }): Promise<{ fetchResponse: Response; status: "EMAIL_ALREADY_VERIFIED_ERROR" | "OK" }>
    • Send an email to the user for verification.

      throws

      STGeneralError if the API exposed by the backend SDKs returns status: "GENERAL_ERROR"

      Parameters

      Returns Promise<{ fetchResponse: Response; status: "EMAIL_ALREADY_VERIFIED_ERROR" | "OK" }>

      {status: "OK"} if successfull

  • verifyEmail:function
    • verifyEmail(input: { options?: RecipeFunctionOptions; userContext: any }): Promise<{ fetchResponse: Response; status: "OK" | "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>
UserInput: { override?: InputTypeOverride } & RecipeModuleUserInput<PreAndPostAPIHookAction>

Variables

EmailVerificationClaim: EmailVerificationClaimClass = RecipeWrapper.EmailVerificationClaim

Functions

  • getEmailVerificationTokenFromURL(input?: { userContext?: any }): string
  • getTenantIdFromURL(input?: { userContext?: any }): undefined | string
  • init(config?: UserInput): CreateRecipeFunction<PreAndPostAPIHookAction>
  • isEmailVerified(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; isVerified: boolean; status: "OK" }>
  • sendVerificationEmail(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "EMAIL_ALREADY_VERIFIED_ERROR" }>
  • verifyEmail(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>

Generated using TypeDoc