fix(01-02): resolve compilation errors in auth models

- Fixed import path in AuthRepository to reach core errors
- Updated AuthUser.fromSupabase() to handle DateTime parsing safely
- Added UnknownAuthException for fallback error handling
- Fixed null-aware operators in AuthUser model
- All authentication files now compile without errors
This commit is contained in:
Dani B
2026-01-28 09:34:56 -05:00
parent 06e3ea48fb
commit 58f2b5bce4
3 changed files with 17 additions and 4 deletions

View File

@@ -146,6 +146,19 @@ class AuthDisabledException extends AuthException {
);
}
/// Exception thrown for unknown authentication errors
class UnknownAuthException extends AuthException {
const UnknownAuthException({
String message = 'An unknown authentication error occurred',
String? code,
dynamic originalError,
}) : super(
message: message,
code: code ?? 'UNKNOWN_ERROR',
originalError: originalError,
);
}
/// Utility class for converting Supabase errors to custom exceptions
///
/// Provides a centralized way to map Supabase error responses
@@ -263,7 +276,7 @@ class AuthExceptionFactory {
}
// Fallback for unknown errors
return AuthException(
return UnknownAuthException(
message: _extractUserFriendlyMessage(errorMessage) ?? 'Authentication failed',
code: errorCode,
originalError: error,