Type Aliases
GetRedirectionURLContext
GetRedirectionURLContext: never
OnHandleEventContext
OnHandleEventContext: { action: "TOTP_CODE_VERIFIED"; userContext: UserContext } | { action: "TOTP_DEVICE_VERIFIED"; deviceName: string; userContext: UserContext; wasAlreadyVerified: boolean } | { action: "TOTP_DEVICE_CREATED"; deviceName: string; userContext: UserContext }
PreAPIHookContext
PreAPIHookContext: { action: PreAndPostAPIHookAction; requestInit: RequestInit; url: string; userContext: UserContext }
Type declaration
action: PreAndPostAPIHookAction
requestInit: RequestInit
url: string
userContext: UserContext
RecipeInterface
RecipeInterface: { createDevice: any; listDevices: any; removeDevice: any; verifyCode: any; verifyDevice: any }
Type declaration
createDevice:function
- createDevice(input: { deviceName?: string; options?: RecipeFunctionOptions; userContext: any }): Promise<{ deviceName: string; fetchResponse: Response; qrCodeString: string; secret: string; status: "OK" } | { fetchResponse: Response; status: "DEVICE_ALREADY_EXISTS_ERROR" }>
Parameters
input: { deviceName?: string; options?: RecipeFunctionOptions; userContext: any }
Optional deviceName?: string
Optional options?: RecipeFunctionOptions
userContext: any
Returns Promise<{ deviceName: string; fetchResponse: Response; qrCodeString: string; secret: string; status: "OK" } | { fetchResponse: Response; status: "DEVICE_ALREADY_EXISTS_ERROR" }>
listDevices:function
- listDevices(input: { options?: RecipeFunctionOptions; userContext: any }): Promise<{ devices: { name: string; period: number; skew: number; verified: boolean }[]; fetchResponse: Response; status: "OK" }>
Parameters
input: { options?: RecipeFunctionOptions; userContext: any }
Optional options?: RecipeFunctionOptions
userContext: any
Returns Promise<{ devices: { name: string; period: number; skew: number; verified: boolean }[]; fetchResponse: Response; status: "OK" }>
removeDevice:function
- removeDevice(input: { deviceName: string; options?: RecipeFunctionOptions; userContext: any }): Promise<{ didDeviceExist: boolean; fetchResponse: Response; status: "OK" }>
Parameters
input: { deviceName: string; options?: RecipeFunctionOptions; userContext: any }
deviceName: string
Optional options?: RecipeFunctionOptions
userContext: any
Returns Promise<{ didDeviceExist: boolean; fetchResponse: Response; status: "OK" }>
verifyCode:function
- verifyCode(input: { options?: RecipeFunctionOptions; totp: string; userContext: any }): Promise<{ fetchResponse: Response; status: "OK" } | { currentNumberOfFailedAttempts: number; fetchResponse: Response; maxNumberOfFailedAttempts: number; status: "INVALID_TOTP_ERROR" } | { fetchResponse: Response; retryAfterMs: number; status: "LIMIT_REACHED_ERROR" }>
Parameters
input: { options?: RecipeFunctionOptions; totp: string; userContext: any }
Optional options?: RecipeFunctionOptions
totp: string
userContext: any
Returns Promise<{ fetchResponse: Response; status: "OK" } | { currentNumberOfFailedAttempts: number; fetchResponse: Response; maxNumberOfFailedAttempts: number; status: "INVALID_TOTP_ERROR" } | { fetchResponse: Response; retryAfterMs: number; status: "LIMIT_REACHED_ERROR" }>
verifyDevice:function
- verifyDevice(input: { deviceName: string; options?: RecipeFunctionOptions; totp: string; userContext: any }): Promise<{ fetchResponse: Response; status: "OK"; wasAlreadyVerified: boolean } | { currentNumberOfFailedAttempts: number; fetchResponse: Response; maxNumberOfFailedAttempts: number; status: "INVALID_TOTP_ERROR" } | { fetchResponse: Response; status: "UNKNOWN_DEVICE_ERROR" } | { fetchResponse: Response; retryAfterMs: number; status: "LIMIT_REACHED_ERROR" }>
Parameters
input: { deviceName: string; options?: RecipeFunctionOptions; totp: string; userContext: any }
deviceName: string
Optional options?: RecipeFunctionOptions
totp: string
userContext: any
Returns Promise<{ fetchResponse: Response; status: "OK"; wasAlreadyVerified: boolean } | { currentNumberOfFailedAttempts: number; fetchResponse: Response; maxNumberOfFailedAttempts: number; status: "INVALID_TOTP_ERROR" } | { fetchResponse: Response; status: "UNKNOWN_DEVICE_ERROR" } | { fetchResponse: Response; retryAfterMs: number; status: "LIMIT_REACHED_ERROR" }>