Skip to content

Commit 2349ceb

Browse files
xyzqmRich-Harris
andauthored
docs: fix repl login (#10295)
* fix &lt; and &gt; rendering in search results * should fix auth window issues * more fixes --------- Co-authored-by: Rich Harris <[email protected]>
1 parent d5e4607 commit 2349ceb

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

sites/svelte.dev/src/routes/(authed)/+layout.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
);
1212
1313
window.addEventListener('message', function handler(event) {
14+
if (event.data.source !== 'svelte-auth') return;
1415
login_window.close();
1516
window.removeEventListener('message', handler);
1617
invalidateAll();

sites/svelte.dev/src/routes/auth/callback/+server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ export async function GET({ url }) {
3333
github_login: profile.login,
3434
github_avatar_url: profile.avatar_url
3535
};
36-
3736
const { sessionid, expires } = await session.create(user);
3837

3938
return new Response(
4039
`
4140
<script>
4241
window.opener.postMessage({
42+
source: 'svelte-auth',
4343
user: ${uneval(user)}
4444
}, window.location.origin);
4545
</script>

sites/svelte.dev/src/routes/auth/login/+server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const GET = client_id
1212
}).toString();
1313

1414
redirect(302, Location);
15-
}
15+
}
1616
: () =>
1717
new Response(
1818
`

0 commit comments

Comments
 (0)