Skip to content
Discussion options

You must be logged in to vote

Hello,

Here an exempe: https://github.com/insamee-app/mee/blob/master/plugins/getProfile.server.js (and check others parts of this repo).

But the process, in a big picture, is:

  • Authenticate your user (using a login page)
  • If everything is ok, Adonis will send you a cookie using the HTTP header Set Cookie
  • Then, you will be able to do request to your API (Adonis) thanks to HTTP and your browser which set automatically cookies (if same domain)
  • When your user will start another session (restart his browser but still login thanks to the cookie), you don't know if the authentication is valide (client-side). The tricks is to do a request to try to get the user associated to the cookie when this …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@galaczi
Comment options

Answer selected by galaczi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants