signOut method
//////////// //////////// Signs out the current user
Implementation
// II.D - Session Management
///////////////
/// Signs out the current user
Future<void> signOut() async {
try {
await _googleSignIn.signOut(); // Sign out from Google
return await _auth.signOut(); // Sign out from Firebase
} on FirebaseAuthException catch (e) {
throw RALIException('Failed to sign out: ${e.message}', cause: e);
} catch (e) {
// Handle other error types
if (e is RALIException) {
// Already a RALIException, just rethrow
rethrow;
}
// Log the error for debugging
logError(e, StackTrace.current, context: 'signOut');
throw RALIException('An unexpected error occurred during sign out', cause: e);
}
}