Email confirmation page after SignUp

This commit is contained in:
Arseni
2026-01-13 15:31:13 +03:00
parent dedde76dd7
commit 5d330c8ccc
12 changed files with 343 additions and 9 deletions

View File

@@ -191,6 +191,15 @@ class AccountProvider extends ChangeNotifier {
}
}
Future<void> resendVerificationEmail(String email) async {
try {
await AccountService.resendVerificationEmail(email);
} catch (e) {
_setResource(_resource.copyWith(error: toException(e)));
rethrow;
}
}
Future<void> logout() async {
_authState = AuthState.empty;
_setResource(_resource.copyWith(isLoading: true, error: null));

View File

@@ -57,6 +57,11 @@ class AccountService {
await getPUTResponse(_objectType, 'password', ForgotPasswordRequest.build(login: email).toJson());
}
static Future<void> resendVerificationEmail(String email) async {
_logger.fine('Resending verification email');
await getPUTResponse(_objectType, 'email', {'login': email});
}
static Future<void> resetPassword(String accountRef, String token, String newPassword) async {
_logger.fine('Resetting password for account: $accountRef');
await getPOSTResponse(_objectType, 'password/reset/$accountRef/$token', ResetPasswordRequest.build(password: newPassword).toJson());