Merge pull request #9858 from appwrite/update-flutter-docs

chore: update flutter_web_auth_2 docs to match 4.x
This commit is contained in:
Steven Nguyen 2025-05-22 15:14:25 -07:00 committed by GitHub
commit 1e220766b2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 24 additions and 7 deletions

View file

@ -1,6 +1,11 @@
# Change Log
## 16.0.1
## 16.1.1
* Update `flutter_web_auth_2` dependency to version 4.1.0
* Update `auth.html` example in README.md to align with `flutter_web_auth_2` documentation
## 16.1.0
* Add `setDevKey` method to Client service
* Add `upsertDocument` method to Databases service

View file

@ -56,13 +56,25 @@ For web in order to capture the OAuth2 callback URL and send it to the applicati
```html
<!DOCTYPE html>
<title>Authentication complete</title>
<p>Authentication is complete. If this does not happen automatically, please
close the window.
<p>Authentication is complete. If this does not happen automatically, please close the window.</p>
<script>
window.opener.postMessage({
'flutter-web-auth-2': window.location.href
}, window.location.origin);
window.close();
function postAuthenticationMessage() {
const message = {
'flutter-web-auth-2': window.location.href
};
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>
```