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

Register/Login with Email and Password #63

Closed
12 tasks done
nelsonic opened this issue May 1, 2020 · 11 comments
Closed
12 tasks done

Register/Login with Email and Password #63

nelsonic opened this issue May 1, 2020 · 11 comments
Assignees
Labels
awaiting-review An issue or pull request that needs to be reviewed enhancement New feature or enhancement of existing functionality help wanted If you can help make progress with this issue, please comment! priority-2 Second highest priority, should be worked on as soon as the Priority-1 issues are finished T1d Time Estimate 1 Day technical A technical issue that requires understanding of the code, infrastructure or dependencies
Projects

Comments

@nelsonic
Copy link
Member

nelsonic commented May 1, 2020

There will always be people who prefer to use an Email address and Password for Authentication for whatever reason. We need to give them a seamless experience.

Todo

  • Create a Simple form that has a single input field: :email
  • The input should be semantic such that the browser will autocomplete the data:
<input type="email" id="email" size="30" required autofocus placeholder="yourname@email.com">

FYI: this is an interesting article on placeholders: https://www.smashingmagazine.com/2018/06/placeholder-attribute (I'm still using them!)

  • Store referer and auth_client_id as hidden form field state so we can redirect on success.
  • Submit button copy: "Login / Register"
  • Check if there is a person with the given email address.
    • If the person exists and has verified their email address, display the password prompt. (Login)
    • If the person exists but has not verified send them an email reminding them to verify.
  • If the person does not exist, create them and then render the "Please verify" UI

    "please check your email and click the link to verify".

    • Create a Password Form
  • If password is correct redirect to the original referer using the auth_client_secret to sign the JWT
@nelsonic nelsonic added enhancement New feature or enhancement of existing functionality help wanted If you can help make progress with this issue, please comment! priority-2 Second highest priority, should be worked on as soon as the Priority-1 issues are finished T4h Time Estimate 4 Hours technical A technical issue that requires understanding of the code, infrastructure or dependencies labels May 1, 2020
nelsonic added a commit that referenced this issue May 2, 2020
nelsonic added a commit that referenced this issue May 2, 2020
nelsonic added a commit that referenced this issue May 2, 2020
@nelsonic
Copy link
Member Author

nelsonic commented May 2, 2020

iPhone 6/7/8/SE aspect ratio (the most popular iOS device aspect ratio):
image

Need to tidy up the spacing. 📏

@nelsonic
Copy link
Member Author

nelsonic commented May 2, 2020

Removed padding from container and the spacing fixed itself:
image

Very happy for anyone else to tidy up styling, copy etc. (Post MVP).

@nelsonic
Copy link
Member Author

nelsonic commented May 2, 2020

browser validation:
image

@nelsonic
Copy link
Member Author

nelsonic commented May 5, 2020

image

image

When I click the link this is what I see:
image

And in the database we can see that this record has been updated to status=1 (verified)
image

Verification of email address by link sent to email is working. ✅

@nelsonic nelsonic closed this as completed May 5, 2020
@nelsonic nelsonic reopened this May 5, 2020
@nelsonic
Copy link
Member Author

nelsonic commented May 5, 2020

Derp! Didn't mean to close the issue. Still have to finish the password setup stage. 🧑‍💻

@nelsonic nelsonic self-assigned this May 6, 2020
@nelsonic nelsonic added this to To do in dwyl app via automation May 6, 2020
@nelsonic nelsonic moved this from To do to In progress in dwyl app May 6, 2020
@nelsonic nelsonic added in-progress An issue or pull request that is being worked on by the assigned person T1d Time Estimate 1 Day and removed T4h Time Estimate 4 Hours labels May 6, 2020
@nelsonic
Copy link
Member Author

nelsonic commented May 6, 2020

Register with Email+Password works:
image

Now to work on Login. ⏳

@nelsonic
Copy link
Member Author

nelsonic commented May 7, 2020

In case anyone is wondering why I have split the register/login into two steps

  1. input your email address
  2. input your password

It's because several prominent UX-focussed apps/sites have reached the same conclusion:
It reduces friction and increases security. Counterintuitively perhaps because we are not allowing people to simply tab to the next field and submit both email and password in a single HTTP Request. But this helps mitigate phishing attacks and automated login attempts.

Google:
image

Notice how they have the "eye" icon in the password field allowing people to view the password/passphrase they have entered: #65

image

Don't worry, this is not my real password. (duh!)

Read:

AWS: https://signin.aws.amazon.com
image

Ebay:
image

Yahoo and Shopify:
yahoo-shopify

@nelsonic
Copy link
Member Author

nelsonic commented May 8, 2020

Password hashing is performed transparently by Fields.Password using Argon2.
Specifically: github.com/dwyl/fields/lib/helpers.ex#L10-L12
The verification function is: Argon2.verify_pass(password_plaintext, password_hash)
which returns boolean true if the password matches or false if not.

@nelsonic
Copy link
Member Author

nelsonic commented May 8, 2020

This feature is finally included in #43 assigned to @SimonLab for review. :shipit:

@nelsonic nelsonic added awaiting-review An issue or pull request that needs to be reviewed and removed in-progress An issue or pull request that is being worked on by the assigned person labels May 10, 2020
@nelsonic nelsonic assigned SimonLab and unassigned nelsonic May 10, 2020
@nelsonic nelsonic moved this from In progress to Awaiting review in dwyl app May 10, 2020
SimonLab added a commit that referenced this issue May 19, 2020
@nelsonic
Copy link
Member Author

Shipped. 🚀
There are always enhancements https://github.com/dwyl/auth/issues we can add later. #HelpWanted

dwyl app automation moved this from Awaiting review to Done Sep 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-review An issue or pull request that needs to be reviewed enhancement New feature or enhancement of existing functionality help wanted If you can help make progress with this issue, please comment! priority-2 Second highest priority, should be worked on as soon as the Priority-1 issues are finished T1d Time Estimate 1 Day technical A technical issue that requires understanding of the code, infrastructure or dependencies
Projects
dwyl app
  
Done
Development

No branches or pull requests

2 participants