Skip to content

Commit 90d1a41

Browse files
committed
Log out and warn if OIDC provider is invalid.
Fixes #757.
1 parent 853dd20 commit 90d1a41

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

default-views/auth/login-required.hbs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@
2727
const session = await SolidAuthClient.popupLogin({ popupUri })
2828
if (session) {
2929
// Make authenticated request to the server to establish a session cookie
30-
await SolidAuthClient.fetch(location)
30+
const { status } = await SolidAuthClient.fetch(location)
31+
if (status === 401) {
32+
alert(`Invalid login.\n\nDid you set ${session.idp} as your OIDC provider in your profile ${session.webId}?`);
33+
await SolidAuthClient.logout();
34+
}
3135
// Now that we have a cookie, reload to display the authenticated page
3236
location.reload()
3337
}

0 commit comments

Comments
 (0)