Skip to content

Commit 9991b1d

Browse files
committed
Fix failure to log in when requesting binary files
The problem was that the authenticated fetch for establishing a session cookie was not fully completed when reloading the page. This caused a new (non-authenticated) session cookie to be created. This fix changes this fetch request for the session cookie to be a a header request, so that the request is always finalized before the reload is called. An alternative (but less efficient) fix would be to do a regular request, and consume the whole body before reloading the page. Closes #878
1 parent 9b627e4 commit 9991b1d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

default-views/auth/login-required.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
const session = await solid.auth.popupLogin()
3434
if (session) {
3535
// Make authenticated request to the server to establish a session cookie
36-
const {status} = await solid.auth.fetch(location)
36+
const {status} = await solid.auth.fetch(location, { method: 'HEAD' })
3737
if (status === 401) {
3838
alert(`Invalid login.\n\nDid you set ${session.idp} as your OIDC provider in your profile ${session.webId}?`)
3939
await solid.auth.logout()

0 commit comments

Comments
 (0)