Skip to content

Commit

Permalink
feat: add changePassword
Browse files Browse the repository at this point in the history
  • Loading branch information
adar2378 committed Sep 13, 2023
1 parent 30c0e73 commit c75f273
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,17 @@ class AuthCubit extends HydratedCubit<AuthState> {
}
});

Future<void> changePassword({
required String id,
required ChangePasswordRequest changePasswordRequest,
}) =>
_authApiChecker(() async {
await authApi?.authUsersSetPasswordCreate(
id: id,
changePasswordRequest: changePasswordRequest,
);
});

Future<T> _authApiChecker<T>(Future<T> Function() function) async {
if (authApi == null) {
throw Exception('AuthApi is not initialized');
Expand Down

0 comments on commit c75f273

Please sign in to comment.