@@ -70,27 +70,25 @@ Future<Response> onRequest(RequestContext context) async {
70
70
}
71
71
72
72
try {
73
- // Call the AuthService to handle the logic, passing the context flag.
74
- await authService.initiateEmailSignIn (
75
- email,
76
- isDashboardLogin: isDashboardLogin,
77
- );
73
+ // Call the AuthService to handle the logic, passing the context flag.
74
+ await authService.initiateEmailSignIn (
75
+ email,
76
+ isDashboardLogin: isDashboardLogin,
77
+ );
78
78
79
- // Return 202 Accepted: The request is accepted for processing,
80
- // but the processing (email sending) hasn't necessarily completed.
81
- // 200 OK is also acceptable if you consider the API call itself complete.
82
- return Response (statusCode: HttpStatus .accepted);
83
- } on HttpException catch (_) {
84
- // Let the central errorHandler middleware handle known exceptions
85
- rethrow ;
86
- } catch (e, s) {
87
- // Catch unexpected errors from the service layer
88
- _logger.severe ('Unexpected error in /request-code handler' , e, s);
89
- // Let the central errorHandler handle this as a 500
90
- throw const OperationFailedException (
91
- 'An unexpected error occurred while requesting the sign-in code.' ,
92
- );
93
- }
79
+ // Return 202 Accepted: The request is accepted for processing,
80
+ // but the processing (email sending) hasn't necessarily completed.
81
+ // 200 OK is also acceptable if you consider the API call itself complete.
82
+ return Response (statusCode: HttpStatus .accepted);
83
+ } on HttpException catch (_) {
84
+ // Let the central errorHandler middleware handle known exceptions
85
+ rethrow ;
86
+ } catch (e, s) {
87
+ // Catch unexpected errors from the service layer
88
+ _logger.severe ('Unexpected error in /request-code handler' , e, s);
89
+ // Let the central errorHandler handle this as a 500
90
+ throw const OperationFailedException (
91
+ 'An unexpected error occurred while requesting the sign-in code.' ,
92
+ );
93
+ }
94
94
}
95
-
96
-
0 commit comments