mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 08:43:25 +08:00
15 lines
411 B
Plaintext
15 lines
411 B
Plaintext
|
(function() {
|
||
|
const { authResult, baseUrl } = document.getElementById(
|
||
|
"data-auth-result"
|
||
|
).dataset;
|
||
|
const parsedAuthResult = JSON.parse(authResult);
|
||
|
|
||
|
if (!window.opener) {
|
||
|
localStorage.setItem("lastAuthResult", authResult);
|
||
|
window.location.href = `${baseUrl}?authComplete=true`;
|
||
|
} else {
|
||
|
window.opener.Discourse.authenticationComplete(parsedAuthResult);
|
||
|
window.close();
|
||
|
}
|
||
|
})();
|