Skip to content

TypeScript API / @laikacms/server/oauth2 / TOTPCallbacks

Interface: TOTPCallbacks ​

Callbacks for TOTP storage operations

Methods ​

deleteTOTPSecret() ​

ts
deleteTOTPSecret(userId): Promise<void>;

Delete TOTP secret (disable 2FA)

Parameters ​

ParameterType
userIdstring

Returns ​

Promise<void>


getTOTPSecret() ​

ts
getTOTPSecret(userId): Promise<TOTPSecret | null>;

Get TOTP secret for a user

Parameters ​

ParameterType
userIdstring

Returns ​

Promise<TOTPSecret | null>


storeTOTPSecret() ​

ts
storeTOTPSecret(secret): Promise<void>;

Store TOTP secret for a user

Parameters ​

ParameterType
secretTOTPSecret

Returns ​

Promise<void>


updateTOTPSecret() ​

ts
updateTOTPSecret(userId, updates): Promise<void>;

Update TOTP secret

Parameters ​

ParameterType
userIdstring
updatesPartial<TOTPSecret>

Returns ​

Promise<void>

Released under the MIT License.