Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

break apart auth into login and sign up #109

Open
mattkrick opened this issue Mar 7, 2016 · 2 comments
Open

break apart auth into login and sign up #109

mattkrick opened this issue Mar 7, 2016 · 2 comments

Comments

@mattkrick
Copy link
Owner

SignUp Reqs:

  • Captcha
  • client-side validation
  • Attempt login if user already exists (done)

Login Reqs:

  • no client-side validation
  • hide wrong field (email/pass) from the client (smarter against robot attacks)

Additionally, an expired authToken should not throw an error on either page, it should just be deleted & treated as if the login attempt never happened.

@wenzowski
Copy link
Contributor

should an expired token be deleted, or should it trigger reauth as the same user?

@mattkrick
Copy link
Owner Author

I'm thinking token expiration should be validated on the client & deleted if expired. That way, we don't even hit the server for validation, and that way if an attacker somehow gained access to an expired token, he couldn't trade it in for a valid one. You bring up a good point though about renewals. I think token renewal should be a function on the server, since the token's timestamp is on server time & theoretically someone could set their client clock 1 week ahead & that'd trigger an infinite loop of renewals.

For server renewal, there are a few options:

  • setInterval, if time remaining is < 6 days, renew
  • on socket handshake, if time remaining is < 6 days, renew
  • on socket message, if time remaining...

i like option 2 just because it scales a lot better, and i think it's fair to log someone out if they haven't visited the site in tokenLife - tokenAge days, but I'm open to other ideas.

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

No branches or pull requests

2 participants