-
Notifications
You must be signed in to change notification settings - Fork 793
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
Provide a logout
method on the SDK
#550
Comments
I wrote a similar logout method for this project when I forked this project a while ago. I can throw together something that should get logout functionality available from the SDK. |
@irby Could you please provide the code that does that? I would like to add it manually to my code until you make a PR (or I could make a PR too if you want). Thanks! |
@IgnisDa I'm about 85% done with the PR, and should have it posted here in the next day or so. But, here's the code I wrote some months ago that will expose an endpoint to log out the user. Updating the Session Manager to have a DeleteCookie method: https://github.com/irby/passwordless-authenticator-poc/blob/main/authenticator-backend/session/session.go#L182 (Note updating the Manager interface on line 19) Adding the DeleteCookie method within the Webauthn Test: https://github.com/irby/passwordless-authenticator-poc/blob/main/authenticator-backend/handler/webauthn_test.go#L203 Adding a logout method on user handler: https://github.com/irby/passwordless-authenticator-poc/blob/main/authenticator-backend/handler/user.go#L545 Logout endpoint exposed on the public server: https://github.com/irby/passwordless-authenticator-poc/blob/main/authenticator-backend/server/public_router.go#L69 Once this is added, you should be able to call the logout with POST While making my PR, I noted some opportunities to improve my code. So, my PR will have some different code than what is in here. Just FYI 😅 |
Hello everyone! The logout feature has been merged and the next release will take place next week. Thanks for contributing! |
Checklist
Description
It would be great if the Hanko SDK provided a
logout
method that would remove thehanko_cookie
from the frontend.Describe your ideal solution
Ideally this can be a part of the
UserClient
.Workarounds or alternatives
No response
Hanko Version
v0.3.2
Additional Context
No response
The text was updated successfully, but these errors were encountered: