mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 08:58:35 +00:00
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:
commit
1e220766b2
2 changed files with 24 additions and 7 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
```
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue