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

Password-less Login #71

Merged
merged 23 commits into from
Nov 27, 2018
Merged

Password-less Login #71

merged 23 commits into from
Nov 27, 2018

Conversation

etruta
Copy link
Contributor

@etruta etruta commented Oct 23, 2018

Possibility to login from a link (token).

This has 2 methods:

  1. GET /passwordless/token: To request a passwordless token, that send the token to a webhook (responsible to send the email to account id);
  2. POST /passwordless/login: To login with this token.

The webhook url is setted by env APP_PASSWORDLESS_TOKEN_URL.

This token can be used until expired, your time to expire is setted by env PASSWORDLESS_TOKEN_TTL.

@coveralls
Copy link

coveralls commented Oct 23, 2018

Coverage Status

Coverage increased (+0.4%) to 73.479% when pulling 5e6c10d on etruta:passwordless into a5d4ebf on keratin:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.4%) to 73.477% when pulling 86eb9df on etruta:passwordless into 68df61e on keratin:master.

@cainlevy
Copy link
Member

cainlevy commented Nov 1, 2018

This is next on my list! I hope to get to it within the next few days. 🎉

Copy link
Member

@cainlevy cainlevy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@etruta Love it!

I'd like to upgrade this before release with a nonce or optimistic lock that allows these tokens to expire before the TTL. Right now my best idea is to add an accounts.last_login_at field that is updated as expected, then compare it against a lock field in the token (just like with password resets). Thoughts? I'm happy to contribute that part.

api/passwordless/post_passwordless_login.go Outdated Show resolved Hide resolved
api/passwordless/routing.go Outdated Show resolved Hide resolved
api/test/app.go Outdated Show resolved Hide resolved
config/config.go Outdated Show resolved Hide resolved
@etruta
Copy link
Contributor Author

etruta commented Nov 7, 2018

@cainlevy, What do you think about to update accounts.last_login_at in api.NewSession?

Copy link
Member

@cainlevy cainlevy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cainlevy, What do you think about to update accounts.last_login_at in api.NewSession?

perfect 💯

data/mysql/migrations.go Outdated Show resolved Hide resolved
data/postgres/migrations.go Outdated Show resolved Hide resolved
data/sqlite3/account_store.go Outdated Show resolved Hide resolved
data/testers/account_store_testers.go Show resolved Hide resolved
services/account_last_login.go Outdated Show resolved Hide resolved
services/account_last_login_test.go Show resolved Hide resolved
services/passwordless_token_verifier.go Outdated Show resolved Hide resolved
@cainlevy
Copy link
Member

@etruta I have a bit of extra time coming up. Let me know if I can be of any help?

@etruta
Copy link
Contributor Author

etruta commented Nov 21, 2018

Hi @cainlevy, it's ok. I returned today with more time to this project too, until tomorrow I hope to solve this questions.

Copy link
Member

@cainlevy cainlevy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think ... I think that does it! Thanks for this contribution @etruta!

I'll start working on a demo integration and any bits of documentation needed to release this.

@cainlevy cainlevy merged commit d93523e into keratin:master Nov 27, 2018
@cainlevy
Copy link
Member

cainlevy commented Nov 27, 2018

released in v1.5.0 🎉

@cainlevy cainlevy mentioned this pull request Jun 18, 2019
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.

None yet

3 participants