FEAT: change password

This commit is contained in:
Arthur Simas
2022-05-27 18:55:43 -03:00
parent 0f13d0c590
commit c25d2427c2
5 changed files with 77 additions and 19 deletions
+25
View File
@@ -12,6 +12,7 @@ import {
AuthDisableTotpMfaRequest,
AuthDismissTotpMfaRequest,
AuthVerifyTotpMfaRequest,
AuthChangePasswordRequest,
} from '@victorradael/protospack';
export class AuthClientService implements OnModuleInit {
@@ -181,4 +182,28 @@ export class AuthClientService implements OnModuleInit {
});
});
}
async changePassword({
accessToken,
oldPassword,
newPassword,
}: AuthChangePasswordRequest): Promise<any> {
console.log('AuthClientService', 'ChangePassword');
return new Promise((resolve, reject) => {
this.authService
.changePassword({
accessToken,
oldPassword,
newPassword,
})
.subscribe({
next: resolve,
error: (err) => reject(err.details),
complete() {
console.log('done');
},
});
});
}
}