small fixes

This commit is contained in:
Arseni
2026-02-11 15:26:11 +03:00
parent edb43f9909
commit 0a1e04d0d6
7 changed files with 138 additions and 53 deletions

View File

@@ -15,19 +15,9 @@ class EmailVerificationProvider extends ChangeNotifier {
Exception? get error => _resource.error;
ErrorResponse? get errorResponse =>
_resource.error is ErrorResponse ? _resource.error as ErrorResponse : null;
bool get canResendVerification {
final err = errorResponse;
if (err == null) return false;
switch (err.error) {
case 'not_found':
case 'token_expired':
case 'data_conflict':
case 'internal_error':
return true;
default:
return false;
}
}
int? get errorCode => errorResponse?.code;
bool get canResendVerification =>
errorCode == 400 || errorCode == 410 || errorCode == 500;
Future<void> verify(String token) async {
final trimmed = token.trim();