@@ -226,6 +226,38 @@ export class AccountsClient {
226
226
throw new AccountsError ( err . message ) ;
227
227
}
228
228
}
229
+
230
+ async verifyEmail ( token : string ) : Promise < void > {
231
+ try {
232
+ await this . transport . verifyEmail ( token ) ;
233
+ } catch ( err ) {
234
+ throw new AccountsError ( err . message ) ;
235
+ }
236
+ }
237
+
238
+ async resetPassword ( token : string , newPassword : string ) : Promise < void > {
239
+ try {
240
+ await this . transport . resetPassword ( token , newPassword ) ;
241
+ } catch ( err ) {
242
+ throw new AccountsError ( err . message ) ;
243
+ }
244
+ }
245
+
246
+ async requestPasswordReset ( userId : string , email ?: string ) : Promise < void > {
247
+ try {
248
+ await this . transport . sendResetPasswordEmail ( userId , email ) ;
249
+ } catch ( err ) {
250
+ throw new AccountsError ( err . message ) ;
251
+ }
252
+ }
253
+
254
+ async requestVerificationEmail ( userId : string , email ? : string ) : Promise < void > {
255
+ try {
256
+ await this . transport . sendVerificationEmail ( userId , email ) ;
257
+ } catch ( err ) {
258
+ throw new AccountsError ( err . message ) ;
259
+ }
260
+ }
229
261
}
230
262
231
263
const Accounts = {
@@ -269,6 +301,18 @@ const Accounts = {
269
301
refreshSession ( ) : Promise < void > {
270
302
return this . instance . refreshSession ( ) ;
271
303
} ,
304
+ verifyEmail ( token : string ) : Promise < void > {
305
+ return this . instance . verifyEmail ( token ) ;
306
+ } ,
307
+ resetPassword ( token : string , newPassword : string ) : Promise < void > {
308
+ return this . instance . resetPassword ( token , newPassword ) ;
309
+ } ,
310
+ requestPasswordReset ( userId : string , email ?: string ) : Promise < void > {
311
+ return this . instance . requestPasswordReset ( userId , email ) ;
312
+ } ,
313
+ requestVerificationEmail ( userId : string , email ? : string ) : Promise < void > {
314
+ return this . instance . requestVerificationEmail ( userId , email ) ;
315
+ } ,
272
316
} ;
273
317
274
318
export default Accounts ;
0 commit comments