Hi!
does anyone know if the docs actually explain how to use the login/logout modes?
on the api auth page it only says:
```
mode string
Whether to retrieve the refresh token in the JSON response, or in a httpOnly cookie.
```
wich is not very helpful.
I wonder if the docs explain the mode options and how they work.
thanks !
1 Answer
1
Hi, Thanks for the message.
The authentication mode options are: ‘json’, ‘cookie’, ‘session’
The ‘cookie’ mode is legacy so avoid that one. ‘Session’ mode returns a cookie, and ‘json’ mode returns a JSON object containing your token and refresh token.
This guide may be helpful if you haven’t seen it yet.
Are you using the Directus SDK? It has code autocomplete which will help.
Hi and thanks for your reply, I found my answer! I have a really hard time browsing the docs. Many pages have partial information like this api auth page that mentions the mode without listing the possible options. The guide explains the different tokens, but we need to visit another page to find out how to logout in session mode. Why is there no page explaining the full login => logout process with all modes, all options, all details ? thanks again !
– Posoroko