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

[Editor]: Allow logging out #1039

Merged
merged 11 commits into from
Nov 25, 2024
Merged

[Editor]: Allow logging out #1039

merged 11 commits into from
Nov 25, 2024

Conversation

cmoinier
Copy link
Collaborator

@cmoinier cmoinier commented Nov 14, 2024

Description

This PR adds the logging out logic to the sidebar button in the editor.
When the user clicks on the logout button, the session ends and the user is redirected to the logging page.

Quality Assurance Checklist

  • Commit history is devoid of any merge commits and readable to facilitate reviews
  • If new logic ⚙️ is introduced: unit tests were added
  • If new user stories 🤏 are introduced: E2E tests were added
  • If new UI components 🕹️ are introduced: corresponding stories in Storybook were created
  • If breaking changes 🪚 are introduced: add the breaking change label
  • If bugs 🐞 are fixed: add the backport <release branch> label
  • The documentation website 📚 has received the love it deserves

Copy link
Contributor

github-actions bot commented Nov 14, 2024

Affected libs: api-repository, feature-catalog, feature-record, feature-router, feature-editor, feature-search, feature-map, feature-dataviz, feature-auth, util-app-config,
Affected apps: metadata-editor, datahub, demo, webcomponents, map-viewer, search, datafeeder,

  • 🚀 Build and deploy storybook and demo on GitHub Pages
  • 📦 Build and push affected docker images

Copy link
Contributor

github-actions bot commented Nov 14, 2024

📷 Screenshots are here!

@coveralls
Copy link

coveralls commented Nov 14, 2024

Coverage Status

coverage: 84.796% (+1.6%) from 83.209%
when pulling 08547bb on ME-logout
into 89e0d3b on main.

Copy link
Collaborator

@Angi-Kinas Angi-Kinas left a comment

Choose a reason for hiding this comment

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

Thanks Camille for implementing a log out functionality, it will be important for the users! 🎉

I found some little things which I think need to be changed/ reviewed again. I haven't manually tested the functionality yet.
Let me know if something is not clear.

Copy link
Collaborator

@Angi-Kinas Angi-Kinas left a comment

Choose a reason for hiding this comment

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

Thanks @cmoinier the PR looks good!

I still have some doubts about setting the url (after logout) to the url that was present during log in. But maybe I did not understand it correctly.
Can you have another look?

@jahow
Copy link
Collaborator

jahow commented Nov 25, 2024

@cmoinier GeoNetwork offers a logout service similar to the login one, which a redirect option. For instance this is what it can look like:

https://geonetwork-ui.apps.gs-ch-prod.camptocamp.com/geonetwork/signout?redirectUrl=https://geonetwork-ui.apps.gs-ch-prod.camptocamp.com/geonetwork/srv

@cmoinier
Copy link
Collaborator Author

cmoinier commented Nov 25, 2024

@cmoinier GeoNetwork offers a logout service similar to the login one, which a redirect option. For instance this is what it can look like:

https://geonetwork-ui.apps.gs-ch-prod.camptocamp.com/geonetwork/signout?redirectUrl=https://geonetwork-ui.apps.gs-ch-prod.camptocamp.com/geonetwork/srv

I precisely tried that in the first place 🙁 But it kept bringing me back to the login page with an error saying the credentials are wrong... No idea why though!

This is why I opted for a request rather than a redirect because then I didn't get that strange error

@jahow
Copy link
Collaborator

jahow commented Nov 25, 2024

Oh right, actually it makes sense that it puts you again on the login form once you log out, because trying to access the editor while not logged in will redirect you to the login form... Your solution is the best I think!

Copy link
Collaborator

@Angi-Kinas Angi-Kinas left a comment

Choose a reason for hiding this comment

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

@cmoinier sorry for the back and forth. I was wrong with not keeping the previous URL.

Good job! 🚀

@cmoinier cmoinier merged commit 67cb636 into main Nov 25, 2024
13 checks passed
@cmoinier cmoinier deleted the ME-logout branch November 25, 2024 17:26
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.

4 participants