Log out API

Options
How to create log out api any idea?? 
What exactly I will do for log out API 
If once token is created by login API then how to delete that token or destroy that token using log out API

Comments

  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options
    Hey  logging out is handled by the front-end. You just need to forget the token from your front-end. Usually this is done within local or session storage. Once the token is forgotten the user is logged out. So a new token would need to be generated to log in again via the /login API
  • mattdetails
    Options

    For anyone coming to this and not finding the other answer to be enough….and if you are using Wized like I am - I figured out that if you create an action and on click you set a cookie value to null, it is the same thing as essentially forgetting or destroying a cookie.

    After having done it, it feels like a no-brainer but for some reason it wasn't clicking.

  • joefromkansas
    Options

    Thank you for leaving this method here. I was wondering the same thing!

  • joefromkansas
    Options

    Here's how I built this based on the example above. Essentially only clearing my user_id cookie value and sending them to a confirmation page.

  • Khan aqib
    Khan aqib Member
    edited September 2023
    Options

    thanks