Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clear authorization metadata #536

Merged
merged 1 commit into from
Apr 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/login/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,8 @@ export function renderSignInPopup (dom: HTMLDocument) {

const loginToIssuer = async (issuerUri: string) => {
try {
// clear authorization metadata from store
solidLogicSingleton.store.updater.flagAuthorizationMetadata() as any
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the metadata should be flagged as well on log out

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is done lines 711-712

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

solidLogicSingleton.store.updater.flagAuthorizationMetadata() as any

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah sorry, I thought it is login as well because github stripped away the context. all good

// Save hash
const preLoginRedirectHash = new URL(window.location.href).hash
if (preLoginRedirectHash) {
Expand Down Expand Up @@ -706,6 +708,9 @@ authSession.onLogout(async () => {
const issuer = window.localStorage.getItem('loginIssuer')
if (issuer) {
try {
// clear authorization metadata from store
solidLogicSingleton.store.updater.flagAuthorizationMetadata() as any

const wellKnownUri = new URL(issuer)
wellKnownUri.pathname = '/.well-known/openid-configuration'
const wellKnownResult = await fetch(wellKnownUri.toString())
Expand Down