Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

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

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
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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants