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 button #17

Merged
merged 2 commits into from
Jun 1, 2022
Merged

Fix logout button #17

merged 2 commits into from
Jun 1, 2022

Conversation

alembiewski
Copy link
Collaborator

This PR fixes logout functionality by introducing a new LogoutButton component, responsible for sending logout requests to the backend auth service. A few important points:

  • The logout method in the backed accepts the POST method instead of GET
  • Only the authorization header is supported in the current version of the auth service
  • Post-redirect URL is returned after successful logout

}

/**
* Set 'Authorization' header based on the existing cookie.
Copy link

Choose a reason for hiding this comment

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

looking at this page the authservice creates a session cookie.
does the logout button with the suggested change delete this cookie?
meaning... once logged out from one user, can we immediately log in with a new user with no issues?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, a session cookie is removed after the user logs out, it is done via Set-Cookie header: https://github.com/arrikto/oidc-authservice/blob/ae92e8656c5252eddb305f6b9bb72ae1e1e61f6c/session.go#L75

Copy link

Choose a reason for hiding this comment

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

perfect!

Copy link

@MessKon MessKon left a comment

Choose a reason for hiding this comment

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

LGTM ✅

@alembiewski alembiewski merged commit 8be08df into kaptain/v1.5-branch Jun 1, 2022
@alembiewski alembiewski deleted the fix-logout branch June 1, 2022 11:20
alembiewski added a commit that referenced this pull request Aug 8, 2022
* Pin alpine repository version

* Introduce a new LogoutButton component
MessKon pushed a commit that referenced this pull request Oct 19, 2022
* Pin alpine repository version

* Introduce a new LogoutButton component
MessKon pushed a commit that referenced this pull request Oct 20, 2022
* Pin alpine repository version

* Introduce a new LogoutButton component
alembiewski added a commit that referenced this pull request Feb 6, 2023
* Pin alpine repository version

* Introduce a new LogoutButton component
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants