Skip to content

Conversation

@deiucanta
Copy link
Contributor

Instead of checking for explicit routes, this tries to exclude any unwanted routes and store anything else. All of the following 5 conditions have to be met in order to save the current path

  1. User must not be logged in (saves some resources)
  2. Route must not be /login (you don't want to get back to login after login)
  3. Route must not be /signup (same reason as above)
  4. Route must not start with /auth (same reason as above)
  5. Path does not contain a dot (this usually matches a file and you don't want to be redirected to favicon.ico)

@vincentbriglia
Copy link

since passport is prevalently used, wouldn't https://github.com/jaredhanson/connect-ensure-login be a better option ?

@sahat sahat merged commit 3399bfd into sahat:master Jul 13, 2016
@sahat
Copy link
Owner

sahat commented Jul 13, 2016

Thanks for the pull request and sorry about the delay in merging it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants