docs: fix repl login (#10295)

* fix < and > rendering in search results

* should fix auth window issues

* more fixes

---------

Co-authored-by: Rich Harris <rich.harris@vercel.com>
pull/10462/head
Daniel Zhu 5 months ago committed by GitHub
parent d5e460768c
commit 2349cebc38
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -11,6 +11,7 @@
); );
window.addEventListener('message', function handler(event) { window.addEventListener('message', function handler(event) {
if (event.data.source !== 'svelte-auth') return;
login_window.close(); login_window.close();
window.removeEventListener('message', handler); window.removeEventListener('message', handler);
invalidateAll(); invalidateAll();

@ -33,13 +33,13 @@ export async function GET({ url }) {
github_login: profile.login, github_login: profile.login,
github_avatar_url: profile.avatar_url github_avatar_url: profile.avatar_url
}; };
const { sessionid, expires } = await session.create(user); const { sessionid, expires } = await session.create(user);
return new Response( return new Response(
` `
<script> <script>
window.opener.postMessage({ window.opener.postMessage({
source: 'svelte-auth',
user: ${uneval(user)} user: ${uneval(user)}
}, window.location.origin); }, window.location.origin);
</script> </script>

Loading…
Cancel
Save