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

fix: logout from both idp and app #60

Merged
merged 5 commits into from
Jun 26, 2024
Merged

Conversation

garciafdezpatricia
Copy link
Contributor

Fix: logging out of OPs that support Solid-OIDC and those that do not.

Description of changes

When logging out from an OP, AMC was sending a post-logout URL as part of the metadata used in DCR. This is incorrect for those OPs that don't support Solid-OIDC Client Identifiers, resulting in an error being shown to the user.
AMC now distinguishes between OPs supporting Solid-OIDC and those that do not, logging the user out accordingly.

User testing instructions

Commit checklist

  • All acceptance criteria are met.
  • Includes tests to ensure functionality, accessibility and prevent regressions, including E2E tests for supported browsers.
  • Relevant documentation, if any, has been written/updated.
  • The changelog has been updated, if applicable.
  • A changeset version has been created, if applicable.
  • Meets Inrupt coding standards and adheres to commit conventions.

Design requirements checklist

  • Meets Inrupt API Design and UX standards
  • Is responsive to our documented minimum supported screen size + resolution
  • Code is extensible by external contributors or anyone forking

@garciafdezpatricia garciafdezpatricia requested a review from a team as a code owner June 6, 2024 12:20
Copy link

vercel bot commented Jun 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
authorization-management-component ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 24, 2024 5:23pm

Comment on lines 37 to 46
const isUrl = (candidateUrl: string | URL) => {
try {
// If url is not URL-shaped, this will throw.
// eslint-disable-next-line no-new
new URL(candidateUrl);
return true;
} catch (_e) {
return false;
}
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you try removing this, and using a call to URL.canParse instead? It's a fairly recent addition to browsers, but I think because we are transpiling the code targeting an older EcmaScript version we should be good there and not become unaccessible for older browsers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not having any problems locally either when running the tests nor the app itself, but URL.canParse is causing some failures on the Vercel deployment as well as in the e2e execution. Do you have any ideas on how to fix that?

src/components/Header/Header.tsx Outdated Show resolved Hide resolved
src/components/Header/Header.tsx Show resolved Hide resolved
src/components/Header/Header.tsx Show resolved Hide resolved
* Added comments on the new logout handler function.
* Replaced local function isUrl by URL.canParse.
* Adjusted post-logout URL construction.
* Updated logout flow in e2e login tests.
- Updated @inrupt/solid-client-authn-browser and @inrupt/solid-client-authn-node to last version, with the bug fix for the parsing of clientAppId.
- Added a workaround for URL.canParse as lint was complaining about it.
- Updated index e2e test as it was before to check if it still needs the change.
@garciafdezpatricia garciafdezpatricia merged commit 6923b3c into main Jun 26, 2024
7 of 9 checks passed
@garciafdezpatricia garciafdezpatricia deleted the fix/logout-idp-and-app branch June 26, 2024 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants