Open kgilles opened 5 months ago
Yeah the Sublinks Native API will support that.
@kgilles Added 2 ( 3 ) possibilities.
/api/v1/person/logout
( is a straight up alias for /api/v1/session/invalidate )api/1v/session/invalidate
api/v1/session/person
=> get the "key" ( or in this case the id ) related to the logged in token and then you can invalidate ( or delete it ) with DELETE /api/v1/person/invalidate/{sessionkey}
or DELETE /api/v1/data/{sessionkey}
( currently in the #359 branch )
Today there's no way to invalidate an auth token via the API. Which means when a user logs out via the UI, the frontend can't tell the backend to remove the active token connected to the user. This token can still be used to make API requests.
This isn't necessarily a big security threat as long as the frontend promptly removes all references to this token, and the token itself is given a very short lifetime. However, I want to share some reasons in favor of deleting these tokens in the backend on logout.
validate_auth
* API route response(according to my personal expectations that the it return falsy after the user has logged out).* I'm developing restricted frontend routes which requires the user to be logged in, such as the "create a post"-page. I'd like to use the
validate_auth
route to know whether the user is logged in or not. And direct the user to the login page if I receive a non-OK response.Open to discuss.