Giter Club home page Giter Club logo

Comments (4)

irby avatar irby commented on May 18, 2024

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.

IgnisDa avatar IgnisDa commented on May 18, 2024

@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.

irby avatar irby commented on May 18, 2024

@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.

bjoern-m avatar bjoern-m commented on May 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.