Skip to content

Instantly share code, notes, and snippets.

@guilhermesimoes
Last active October 15, 2016 23:26
Show Gist options
  • Save guilhermesimoes/369c8af771720774adf7 to your computer and use it in GitHub Desktop.
Save guilhermesimoes/369c8af771720774adf7 to your computer and use it in GitHub Desktop.
How authentication should work (in my mind)
Page / User State Logged Out Logged In
/public-page Go to /public-page Go to /public-page
/page-requiring-auth
  1. Redirect to /login
  2. After successful login redirect to /page-requiring-auth
Go to /page-requiring-auth
/login
  1. Go to /login
  2. After successful login redirect to /
Redirect to /
/logout Redirect to /
  1. Log out the user
  2. Redirect to /
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment