forked from baron/baron-sso
fix: SSO 팝업 로그인 시 postMessage 흐름 보장 및 콜백 페이지 팝업 대응 #243
This commit is contained in:
@@ -117,6 +117,8 @@ class _LoginScreenState extends ConsumerState<LoginScreen>
|
||||
|
||||
if (uri.queryParameters.containsKey('redirect_url')) {
|
||||
_redirectUrl = uri.queryParameters['redirect_url'];
|
||||
} else if (uri.queryParameters.containsKey('redirect_uri')) {
|
||||
_redirectUrl = uri.queryParameters['redirect_uri'];
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -1124,13 +1126,14 @@ class _LoginScreenState extends ConsumerState<LoginScreen>
|
||||
if (WebAuthIntegration.isPopup()) {
|
||||
debugPrint("[Auth] Popup detected. Notifying opener and attempting to close.");
|
||||
WebAuthIntegration.sendLoginSuccess(token);
|
||||
} else {
|
||||
if (_redirectUrl != null && _redirectUrl!.isNotEmpty) {
|
||||
debugPrint("[Auth] Redirecting standalone window to: $_redirectUrl");
|
||||
final target = "$_redirectUrl?token=$token";
|
||||
launchUrlString(target, webOnlyWindowName: '_self');
|
||||
return;
|
||||
}
|
||||
return; // Stop here for popups
|
||||
}
|
||||
|
||||
if (_redirectUrl != null && _redirectUrl!.isNotEmpty) {
|
||||
debugPrint("[Auth] Redirecting standalone window to: $_redirectUrl");
|
||||
final target = "$_redirectUrl?token=$token";
|
||||
launchUrlString(target, webOnlyWindowName: '_self');
|
||||
return;
|
||||
}
|
||||
|
||||
debugPrint("[Auth] Login success. Navigating to root.");
|
||||
|
||||
Reference in New Issue
Block a user