Comments (4)
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.
from hanko.
@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!
from hanko.
@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 /users/logout
.
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 😅
from hanko.
Hello everyone!
The logout feature has been merged and the next release will take place next week.
Thanks for contributing!
from hanko.
Related Issues (20)
- User export HOT 1
- Fix Syntax Error in Code HOT 1
- Improve layout shift on load HOT 4
- Add Scroll-to-Top Button for Improved User Experience HOT 1
- hanko-auth: Session expired error after logout / on reload HOT 1
- Release binaries for the backend CLI HOT 1
- Deleting a user as an admin is not handled gracefully for the user
- NextJS build failed because of `ReferenceError: CustomEvent is not defined` HOT 3
- Passkey created during onboarding doesn't show up in profile
- Add deployment section in docs HOT 1
- New event for signup, as onAuthFlowCompleted triggers for both sign-up/in HOT 2
- Facing issue when integrating Hanko with Remix, as remix does not convert commonjs modules to esmodules automatically
- import users: JSON schema not accurate
- Docker image in Docker Hub
- Alignment of button content HOT 3
- backend: version cmd has empty output when using container
- ci: cli-publish workflow improvements
- Session cookie not set on localhost on safari
- Hanko cookie does not have SameSite attribute
- Improve logging on SAML endpoints
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hanko.