UNPKG

corellium-typescript

Version:
1 lines 732 B
"use strict";exports.createAuthEndpoints=r=>({changePassword:async e=>{const s=await r.POST("/v1/users/change-password",{body:{user:e.userId,"old-password":e.oldPassword,"new-password":e.newPassword}});if(s.error)throw new Error(s.error.error);return s.data},resetPassword:async e=>{const s=await r.POST("/v1/users/reset-password",{body:{token:e.token,totpToken:e.totpToken,"new-password":e.newPassword}});if(s.error)throw new Error(s.error.error);return s.data},sendResetPasswordEmail:async e=>{const s=await r.POST("/v1/users/send-reset-link",{body:e});if(s.error)throw new Error(s.error.error);return s.data},consent:async()=>{const e=await r.POST("/v1/users/agree",{});if(e.error)throw new Error(e.error.error);return e.data}});