Skip to content

Commit 17df05c

Browse files
committed
style(auth): remove extra whitespace in request-code handler
- Reduced the whitespace between blocks in the `onRequest` function - Improved code readability and formatting without changing functionality
1 parent 9fd3a44 commit 17df05c

File tree

1 file changed

+20
-22
lines changed

1 file changed

+20
-22
lines changed

routes/api/v1/auth/request-code/index.dart

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -70,27 +70,25 @@ Future<Response> onRequest(RequestContext context) async {
7070
}
7171

7272
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+
);
7878

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+
}
9494
}
95-
96-

0 commit comments

Comments
 (0)