switch state transport from cookie to query string

workaround safari third-party cookie issues
This commit is contained in:
Jeremy Danyow 2018-03-27 18:49:37 -07:00
parent e82d1df895
commit 1ae5f3f9d8
No known key found for this signature in database
GPG Key ID: 96C45DE6B2C1DF40
2 changed files with 2 additions and 2 deletions

View File

@ -3,7 +3,7 @@
<head>
<title>login | utterances</title>
<script>
opener.notifyAuthorized();
opener.notifyAuthorized(location.search);
close();
</script>
</head>

View File

@ -38,7 +38,7 @@ export const token = new Token();
export function login() {
window.open(`${authorizeUrl}?${param({ redirect_uri })}`);
return new Promise(resolve => (window as any).notifyAuthorized = resolve)
.then(() => fetch(tokenUrl, { mode: 'cors', credentials: 'include' }))
.then(search => fetch(tokenUrl + search, { mode: 'cors' }))
.then(response => {
if (response.ok) {
return response.json();