Search
Preparing search index...
The search index is not available
supertokens-auth-react
Options
All
Public
Public/Protected
All
Inherited
Externals
Menu
supertokens-auth-react
recipe/totp
default
Class default
Hierarchy
default
Index
Constructors
constructor
Properties
Components
Override
Provider
Methods
create
Device
init
list
Devices
remove
Device
verify
Code
verify
Device
Constructors
constructor
new default
(
)
:
default
Returns
default
Properties
Static
Components
Override
Provider
Components
Override
Provider
:
FC
<
PropsWithChildren
<
{
components
:
ComponentOverrideMap
}
>
>
= RecipeComponentsOverrideContextProvider
Methods
Static
create
Device
create
Device
(
input
?:
{
deviceName
?:
string
;
options
?:
RecipeFunctionOptions
;
userContext
?:
UserContext
}
)
:
Promise
<
{
deviceName
:
string
;
fetchResponse
:
Response
;
qrCodeString
:
string
;
secret
:
string
;
status
:
"OK"
}
|
{
fetchResponse
:
Response
;
status
:
"DEVICE_ALREADY_EXISTS_ERROR"
}
>
Parameters
Optional
input:
{
deviceName
?:
string
;
options
?:
RecipeFunctionOptions
;
userContext
?:
UserContext
}
Optional
device
Name
?:
string
Optional
options
?:
RecipeFunctionOptions
Optional
user
Context
?:
UserContext
Returns
Promise
<
{
deviceName
:
string
;
fetchResponse
:
Response
;
qrCodeString
:
string
;
secret
:
string
;
status
:
"OK"
}
|
{
fetchResponse
:
Response
;
status
:
"DEVICE_ALREADY_EXISTS_ERROR"
}
>
Static
init
init
(
config
?:
UserInput
)
:
RecipeInitResult
<
never
,
PreAndPostAPIHookAction
,
OnHandleEventContext
,
NormalisedConfig
>
Parameters
Optional
config:
UserInput
Returns
RecipeInitResult
<
never
,
PreAndPostAPIHookAction
,
OnHandleEventContext
,
NormalisedConfig
>
Static
list
Devices
list
Devices
(
input
?:
{
options
?:
RecipeFunctionOptions
;
userContext
?:
UserContext
}
)
:
Promise
<
{
devices
:
{
name
:
string
;
period
:
number
;
skew
:
number
;
verified
:
boolean
}
[]
;
fetchResponse
:
Response
;
status
:
"OK"
}
>
Parameters
Optional
input:
{
options
?:
RecipeFunctionOptions
;
userContext
?:
UserContext
}
Optional
options
?:
RecipeFunctionOptions
Optional
user
Context
?:
UserContext
Returns
Promise
<
{
devices
:
{
name
:
string
;
period
:
number
;
skew
:
number
;
verified
:
boolean
}
[]
;
fetchResponse
:
Response
;
status
:
"OK"
}
>
Static
remove
Device
remove
Device
(
input
:
{
deviceName
:
string
;
options
?:
RecipeFunctionOptions
;
userContext
?:
UserContext
}
)
:
Promise
<
{
didDeviceExist
:
boolean
;
fetchResponse
:
Response
;
status
:
"OK"
}
>
Parameters
input:
{
deviceName
:
string
;
options
?:
RecipeFunctionOptions
;
userContext
?:
UserContext
}
device
Name
:
string
Optional
options
?:
RecipeFunctionOptions
Optional
user
Context
?:
UserContext
Returns
Promise
<
{
didDeviceExist
:
boolean
;
fetchResponse
:
Response
;
status
:
"OK"
}
>
Static
verify
Code
verify
Code
(
input
:
{
options
?:
RecipeFunctionOptions
;
totp
:
string
;
userContext
?:
UserContext
}
)
:
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
?:
UserContext
}
Optional
options
?:
RecipeFunctionOptions
totp
:
string
Optional
user
Context
?:
UserContext
Returns
Promise
<
{
fetchResponse
:
Response
;
status
:
"OK"
}
|
{
currentNumberOfFailedAttempts
:
number
;
fetchResponse
:
Response
;
maxNumberOfFailedAttempts
:
number
;
status
:
"INVALID_TOTP_ERROR"
}
|
{
fetchResponse
:
Response
;
retryAfterMs
:
number
;
status
:
"LIMIT_REACHED_ERROR"
}
>
Static
verify
Device
verify
Device
(
input
:
{
deviceName
:
string
;
options
?:
RecipeFunctionOptions
;
totp
:
string
;
userContext
?:
UserContext
}
)
:
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
?:
UserContext
}
device
Name
:
string
Optional
options
?:
RecipeFunctionOptions
totp
:
string
Optional
user
Context
?:
UserContext
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"
}
>
Modules
date
Provider
index
recipe/auth
Recipe
recipe/emailpassword
recipe/emailverification
recipe/multifactorauth
recipe/multitenancy
recipe/oauth2provider
recipe/passwordless
recipe/recipe
Module
recipe/session
recipe/thirdparty
recipe/totp
recipe/userroles
default
constructor
Components
Override
Provider
create
Device
init
list
Devices
remove
Device
verify
Code
verify
Device
Generated using
TypeDoc