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) {
if (event.data.source !== 'svelte-auth') return;
login_window.close();
window.removeEventListener('message', handler);
invalidateAll();

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

@ -12,7 +12,7 @@ export const GET = client_id
}).toString();
redirect(302, Location);
}
}
: () =>
new Response(
`

Loading…
Cancel
Save