Skip to content

Commit 9e79bd7

Browse files
Fixed oauth2 redirect to Android, build authentication-service, @claude apply code coverage tests for this PR, #help-wanted
1 parent 12fb3cd commit 9e79bd7

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

authentication-service/src/main/java/com/microservice/authentication/controller/AndroidOAuth2Controller.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public String androidOAuth2Callback(HttpServletRequest request) {
3535
"<head>" +
3636
" <meta charset=\"UTF-8\">" +
3737
" <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">" +
38+
" <meta http-equiv=\"refresh\" content=\"0;url=spendingbetter://oauth2callback\">" +
3839
" <title>Authentication Successful</title>" +
3940
" <style>" +
4041
" body {" +
@@ -52,13 +53,18 @@ public String androidOAuth2Callback(HttpServletRequest request) {
5253
" h1 { margin: 0 0 1rem 0; font-size: 2rem; }" +
5354
" p { margin: 0; font-size: 1.1rem; opacity: 0.9; }" +
5455
" </style>" +
56+
" <script>" +
57+
" // Immediately redirect to the app using custom scheme" +
58+
" window.location.href = 'spendingbetter://oauth2callback';" +
59+
" </script>" +
5560
"</head>" +
5661
"<body>" +
5762
" <div class=\"container\">" +
5863
" <div class=\"success-icon\">✓</div>" +
5964
" <h1>Authentication Successful</h1>" +
60-
" <p>You can close this tab and return to the app.</p>" +
65+
" <p>Redirecting to app...</p>" +
6166
" <p style=\"margin-top: 1rem; opacity: 0.7; font-size: 0.9rem;\">Welcome, " + username + "</p>" +
67+
" <p style=\"margin-top: 2rem; font-size: 0.9rem;\">If you're not redirected, <a href=\"spendingbetter://oauth2callback\" style=\"color: white; text-decoration: underline;\">click here</a></p>" +
6268
" </div>" +
6369
"</body>" +
6470
"</html>";

0 commit comments

Comments
 (0)