mirror of
https://github.com/utterance/utterances.git
synced 2024-09-11 07:15:28 +03:00
switch state transport from cookie to query string
workaround safari third-party cookie issues
This commit is contained in:
parent
e82d1df895
commit
1ae5f3f9d8
@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<title>login | utterances</title>
|
||||
<script>
|
||||
opener.notifyAuthorized();
|
||||
opener.notifyAuthorized(location.search);
|
||||
close();
|
||||
</script>
|
||||
</head>
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user