File tree Expand file tree Collapse file tree
packages/backend/src/api/endpoints Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -79,6 +79,11 @@ type GetOrganizationMembershipListParams = {
7979 offset ?: number ;
8080} ;
8181
82+ type VerifyTOTPParams = {
83+ userId : string ;
84+ code : string ;
85+ } ;
86+
8287export class UserAPI extends AbstractAPI {
8388 public async getUserList ( params : UserListParams = { } ) {
8489 return this . request < User [ ] > ( {
@@ -166,4 +171,15 @@ export class UserAPI extends AbstractAPI {
166171 queryParams : { limit, offset } ,
167172 } ) ;
168173 }
174+
175+ public async verifyTOTP ( params : VerifyTOTPParams ) {
176+ const { userId, code } = params ;
177+ this . requireId ( userId ) ;
178+
179+ return this . request < { verified : true ; code_type : 'totp' } > ( {
180+ method : 'POST' ,
181+ path : joinPaths ( basePath , userId , 'verify_totp' ) ,
182+ bodyParams : { code } ,
183+ } ) ;
184+ }
169185}
You can’t perform that action at this time.
0 commit comments