-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade version flutter_web_auth_2 and fix can't close SSO
- Loading branch information
Showing
2 changed files
with
21 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,22 @@ | ||
<!DOCTYPE html> | ||
<head> | ||
<title>Authentication complete</title> | ||
</head> | ||
<body> | ||
<p>Authentication is complete. If this does not happen automatically, please | ||
close the window. | ||
<script> | ||
window.opener.postMessage({ | ||
<title>Authentication complete</title> | ||
<p>Authentication is complete. If this does not happen automatically, please close the window.</p> | ||
<script> | ||
function postAuthenticationMessage() { | ||
const message = { | ||
'flutter-web-auth-2': window.location.href | ||
}, window.location.origin); | ||
window.close(); | ||
</script> | ||
</body> | ||
}; | ||
|
||
if (window.opener) { | ||
window.opener.postMessage(message, window.location.origin); | ||
window.close(); | ||
} else if (window.parent && window.parent !== window) { | ||
window.parent.postMessage(message, window.location.origin); | ||
} else { | ||
localStorage.setItem('flutter-web-auth-2', window.location.href); | ||
window.close(); | ||
} | ||
} | ||
|
||
postAuthenticationMessage(); | ||
</script> |