-
Notifications
You must be signed in to change notification settings - Fork 1
fix login issue #143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
fix login issue #143
Changes from all commits
8751446
70a947e
8b40173
8a2e815
03ab4d5
fda7957
67a3939
d2ec702
4b135a6
44fd9b7
617de91
c8abf7f
6d22721
d936549
e830ee4
2f96bbb
ec478aa
be59177
293c5dc
e7db7d6
bc35243
1b4861e
ec42754
7e32c93
ea6be28
35b0a3d
3cf1ac0
1d8bb14
e0b9292
0f78914
2eca185
9655019
8721568
f02fdc9
8b94958
c6e0e30
25c4cac
4c63276
c732c7b
48fbe42
fb712d8
c7eb547
ed97499
d2a54f1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| description: This file stores settings for Dart & Flutter DevTools. | ||
| documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states | ||
| extensions: |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| <!DOCTYPE html> | ||
| <html> | ||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <title>Authentication Callback</title> | ||
| <script> | ||
| // This script helps solid_auth handle the OAuth callback. | ||
| // It passes the authorization code back to the parent window | ||
| // and closes the popup if applicable. | ||
| const AUTH_DESTINATION_KEY = "openidconnect_auth_destination_url"; | ||
| const AUTH_RESPONSE_KEY = "openidconnect_auth_response_info"; | ||
|
|
||
| window.onload = function () { | ||
| // Check if this is a popup window | ||
| if (window.opener && window.opener !== window) { | ||
| // Pass the full URL (including code) to the parent window | ||
| window.opener.postMessage(window.location.href, "*"); | ||
| window.close(); | ||
| } else { | ||
| // If not a popup, redirect to the main app with the code | ||
| // This handles the case where the browser doesn't support popups | ||
| const currentUrl = window.location.href; | ||
| if (currentUrl.includes('code=')) { | ||
| // Store the response info for the main window to pick up | ||
| localStorage.setItem(AUTH_RESPONSE_KEY, currentUrl); | ||
| // Redirect to the base URL (the main app will pick up the code) | ||
| window.location.href = window.location.origin + window.location.pathname.replace('/callback.html', '/'); | ||
| } | ||
| } | ||
| } | ||
| </script> | ||
| </head> | ||
| <body> | ||
| <p>Authentication complete. You can close this window.</p> | ||
| <p>If this window does not close automatically, please close it manually.</p> | ||
| </body> | ||
| </html> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -135,24 +135,30 @@ class _SolidDynamicLoginStatusState extends State<SolidDynamicLoginStatus> { | |
| _currentWebId != null && _currentWebId!.isNotEmpty; | ||
|
|
||
| if (isCurrentlyLoggedIn) { | ||
| // Logout scenario - don't recheck status as page will reload | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add an empty line after the comment. Ref: https://survivor.togaware.com/gnulinux/flutter-style-comments.html |
||
|
|
||
| if (widget.onTap != null) { | ||
| widget.onTap!.call(); | ||
| } else { | ||
| SolidAuthHandler.instance.handleLogout(context); | ||
| } | ||
| } else { | ||
| // Login scenario - can delay status check | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add an empty line after the comment. Ref: https://survivor.togaware.com/gnulinux/flutter-style-comments.html |
||
|
|
||
| if (widget.onLogin != null) { | ||
| widget.onLogin!.call(); | ||
| } else { | ||
| SolidAuthHandler.instance.handleLogin(context); | ||
| } | ||
| } | ||
|
|
||
| Future.delayed(const Duration(milliseconds: 500), () { | ||
| if (mounted) { | ||
| _checkLoginStatus(); | ||
| } | ||
| }); | ||
| // Only refresh status for login scenario | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add an empty line after the comment. Ref: https://survivor.togaware.com/gnulinux/flutter-style-comments.html |
||
|
|
||
| Future.delayed(const Duration(milliseconds: 500), () { | ||
| if (mounted) { | ||
| _checkLoginStatus(); | ||
| } | ||
| }); | ||
| } | ||
| } | ||
|
|
||
| @override | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add an empty line after the comment. Ref: https://survivor.togaware.com/gnulinux/flutter-style-comments.html