Search
Preparing search index...
The search index is not available
supertokens-node
Options
All
Public
Public/Protected
All
Inherited
Externals
Menu
supertokens-node
recipe/totp
default
Class default
Hierarchy
default
Index
Constructors
constructor
Properties
init
Methods
create
Device
list
Devices
remove
Device
update
Device
verify
Device
verifyTOTP
Constructors
constructor
new default
(
)
:
default
Returns
default
Properties
Static
init
init
:
(
(
config
?:
TypeInput
)
=>
RecipeListFunction
)
= Recipe.init
Type declaration
(
config
?:
TypeInput
)
:
RecipeListFunction
Parameters
Optional
config:
TypeInput
Returns
RecipeListFunction
Methods
Static
create
Device
create
Device
(
userId
:
string
, userIdentifierInfo
?:
string
, deviceName
?:
string
, skew
?:
number
, period
?:
number
, userContext
?:
Record
<
string
,
any
>
)
:
Promise
<
{
deviceName
:
string
;
qrCodeString
:
string
;
secret
:
string
;
status
:
"OK"
}
|
{
status
:
"DEVICE_ALREADY_EXISTS_ERROR"
}
|
{
status
:
"UNKNOWN_USER_ID_ERROR"
}
>
Parameters
userId:
string
Optional
userIdentifierInfo:
string
Optional
deviceName:
string
Optional
skew:
number
Optional
period:
number
Optional
userContext:
Record
<
string
,
any
>
Returns
Promise
<
{
deviceName
:
string
;
qrCodeString
:
string
;
secret
:
string
;
status
:
"OK"
}
|
{
status
:
"DEVICE_ALREADY_EXISTS_ERROR"
}
|
{
status
:
"UNKNOWN_USER_ID_ERROR"
}
>
Static
list
Devices
list
Devices
(
userId
:
string
, userContext
?:
Record
<
string
,
any
>
)
:
Promise
<
{
devices
:
{
name
:
string
;
period
:
number
;
skew
:
number
;
verified
:
boolean
}
[]
;
status
:
"OK"
}
>
Parameters
userId:
string
Optional
userContext:
Record
<
string
,
any
>
Returns
Promise
<
{
devices
:
{
name
:
string
;
period
:
number
;
skew
:
number
;
verified
:
boolean
}
[]
;
status
:
"OK"
}
>
Static
remove
Device
remove
Device
(
userId
:
string
, deviceName
:
string
, userContext
?:
Record
<
string
,
any
>
)
:
Promise
<
{
didDeviceExist
:
boolean
;
status
:
"OK"
}
>
Parameters
userId:
string
deviceName:
string
Optional
userContext:
Record
<
string
,
any
>
Returns
Promise
<
{
didDeviceExist
:
boolean
;
status
:
"OK"
}
>
Static
update
Device
update
Device
(
userId
:
string
, existingDeviceName
:
string
, newDeviceName
:
string
, userContext
?:
Record
<
string
,
any
>
)
:
Promise
<
{
status
:
"OK"
|
"DEVICE_ALREADY_EXISTS_ERROR"
|
"UNKNOWN_DEVICE_ERROR"
}
>
Parameters
userId:
string
existingDeviceName:
string
newDeviceName:
string
Optional
userContext:
Record
<
string
,
any
>
Returns
Promise
<
{
status
:
"OK"
|
"DEVICE_ALREADY_EXISTS_ERROR"
|
"UNKNOWN_DEVICE_ERROR"
}
>
Static
verify
Device
verify
Device
(
tenantId
:
string
, userId
:
string
, deviceName
:
string
, totp
:
string
, userContext
?:
Record
<
string
,
any
>
)
:
Promise
<
{
status
:
"OK"
;
wasAlreadyVerified
:
boolean
}
|
{
status
:
"UNKNOWN_DEVICE_ERROR"
}
|
{
currentNumberOfFailedAttempts
:
number
;
maxNumberOfFailedAttempts
:
number
;
status
:
"INVALID_TOTP_ERROR"
}
|
{
retryAfterMs
:
number
;
status
:
"LIMIT_REACHED_ERROR"
}
>
Parameters
tenantId:
string
userId:
string
deviceName:
string
totp:
string
Optional
userContext:
Record
<
string
,
any
>
Returns
Promise
<
{
status
:
"OK"
;
wasAlreadyVerified
:
boolean
}
|
{
status
:
"UNKNOWN_DEVICE_ERROR"
}
|
{
currentNumberOfFailedAttempts
:
number
;
maxNumberOfFailedAttempts
:
number
;
status
:
"INVALID_TOTP_ERROR"
}
|
{
retryAfterMs
:
number
;
status
:
"LIMIT_REACHED_ERROR"
}
>
Static
verifyTOTP
verifyTOTP
(
tenantId
:
string
, userId
:
string
, totp
:
string
, userContext
?:
Record
<
string
,
any
>
)
:
Promise
<
{
status
:
"OK"
|
"UNKNOWN_USER_ID_ERROR"
}
|
{
currentNumberOfFailedAttempts
:
number
;
maxNumberOfFailedAttempts
:
number
;
status
:
"INVALID_TOTP_ERROR"
}
|
{
retryAfterMs
:
number
;
status
:
"LIMIT_REACHED_ERROR"
}
>
Parameters
tenantId:
string
userId:
string
totp:
string
Optional
userContext:
Record
<
string
,
any
>
Returns
Promise
<
{
status
:
"OK"
|
"UNKNOWN_USER_ID_ERROR"
}
|
{
currentNumberOfFailedAttempts
:
number
;
maxNumberOfFailedAttempts
:
number
;
status
:
"INVALID_TOTP_ERROR"
}
|
{
retryAfterMs
:
number
;
status
:
"LIMIT_REACHED_ERROR"
}
>
Modules
framework
framework/aws
Lambda
framework/custom
framework/express
framework/fastify
framework/hapi
framework/koa
framework/loopback
index
ingredients/emaildelivery
ingredients/smsdelivery
recipe/accountlinking
recipe/dashboard
recipe/emailpassword
recipe/emailverification
recipe/jwt
recipe/multifactorauth
recipe/multitenancy
recipe/oauth2provider
recipe/openid
recipe/passwordless
recipe/session
recipe/thirdparty
recipe/totp
recipe/usermetadata
recipe/userroles
default
constructor
init
create
Device
list
Devices
remove
Device
update
Device
verify
Device
verifyTOTP
Generated using
TypeDoc