You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 25, 2025. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 25, 2025. It is now read-only.
As a user I can login using my email address and password-less links #437
It'll work like: user enters their email -> 6 digit OTP code gets sent to their email -> user enters the received otp -> logged in for max. time a cookie can set. freeCodeCamp.org and Brave use this methodoly.
And to enter sensitive areas (also called sudo mode in security world) like admin settings an email otp verification will be required.
Don't need 6 digit OTP for login, we can just do login via magic link, right? You enter your email, you click the link sent to your email, bam, you're logged in for X days or until you've manually logged out.
@timmyichen@vkWeb any recommendations for libraries we can use to implement this function? After a quick google search, looks like there is a passport strategy that supports what we need:
@pdotsani@timmyichen I think we should consult @ojeytonwilliams on this. He knows a lot about fCC's main codebase so he might be aware of fCC's strategy to handle passwordless login.
@ojeytonwilliams how do fCC implements passwordless logins? Should we use OTP based auth or magic links?
IMO, security wise magic links and OTPs are equally good. But OTPs have better UX because:
singular flow of auth, no multiple tabs
magic links only work when user and magic link are opened in the same browser, kinda problematic if the user is on a different browser than their default
With magic link transactions, both the initial request and its response must take place in the same browser or the transaction will fail. This is particularly relevant for iOS users, who cannot change their default web browser. For example, the user might make the initial request using the Chrome browser, but when the user opens the magic link in their email, iOS automatically opens it in Safari (the default browser). If this happens, the transaction will fail.
Organizations will need to set up their own email delivery service for this to work, isn't it? wouldn't it be expensive for small and medium organizations...?
I didn't read through the documentation because I assumed if the package is sending an email with a reset link, then the email service doesn't need to do anything special / different than any other transnational email that originates from the server.
Am I missing something? Would the email that's sent be anything more than a text-based email with a hashed link?
@vkWeb fCC uses Auth0 for everything (including passwordless login), so that's not much use here.
I don't have a strong preference for OTP over magic links, and I don't think we should worry about the default browser issue at this stage. Also, unless I'm missing something, switching between the three options (local, magic link and OTP) would not be hard, if we want to just pick one and test it out.
Hoping to move this forward, I would suggest we create a feature pr using this library and see what folks think. A passportjs library seems to be an ideal route for our mvp. Auth0 requires a little more configuration and requires a subscription I believe.
This also depends on if our email service is already available. Does anyone know the status of this? I just want to avoid overlapping work as much as possible.
changed the title [-]As a user I can login using my email address and password[/-][+]As a user I can login using my email address and password-less links[/+]on Mar 26, 2021
Activity
allella commentedon Nov 11, 2020
Thanks @pdotsani
I don't have opinions on the tech-side, but I'll close #306 and PR #411 based on the authentication conversation from the Nov 7th meeting.
vkWeb commentedon Nov 20, 2020
@pdotsani any thoughts on passwordless login?
It'll work like: user enters their email -> 6 digit OTP code gets sent to their email -> user enters the received otp -> logged in for max. time a cookie can set. freeCodeCamp.org and Brave use this methodoly.
And to enter sensitive areas (also called sudo mode in security world) like admin settings an email otp verification will be required.
cc @timmyichen
timmyichen commentedon Nov 20, 2020
I think per @QuincyLarson we should stick with a single form of auth, and Google won out.
vkWeb commentedon Nov 20, 2020
@timmyichen -> https://github.com/freeCodeCamp/chapter/wiki/Meeting-Notes-November-7,-2020#authentication
timmyichen commentedon Nov 20, 2020
Ah, thanks for the more recent context.
Don't need 6 digit OTP for login, we can just do login via magic link, right? You enter your email, you click the link sent to your email, bam, you're logged in for X days or until you've manually logged out.
vkWeb commentedon Nov 20, 2020
@timmyichen Yes that would work too. 👍
pdotsani commentedon Nov 20, 2020
@timmyichen @vkWeb any recommendations for libraries we can use to implement this function? After a quick google search, looks like there is a passport strategy that supports what we need:
https://www.npmjs.com/package/passport-magic-link
This library would need support from our email service of course.
vkWeb commentedon Nov 21, 2020
@pdotsani @timmyichen I think we should consult @ojeytonwilliams on this. He knows a lot about fCC's main codebase so he might be aware of fCC's strategy to handle passwordless login.
@ojeytonwilliams how do fCC implements passwordless logins? Should we use OTP based auth or magic links?
IMO, security wise magic links and OTPs are equally good. But OTPs have better UX because:
Source: https://auth0.com/docs/connections/passwordless/guides/email-magic-link
vkWeb commentedon Nov 21, 2020
Ohh a second thought:
Organizations will need to set up their own email delivery service for this to work, isn't it? wouldn't it be expensive for small and medium organizations...?
@allella what's your thought on this?
allella commentedon Nov 23, 2020
I didn't read through the documentation because I assumed if the package is sending an email with a reset link, then the email service doesn't need to do anything special / different than any other transnational email that originates from the server.
Am I missing something? Would the email that's sent be anything more than a text-based email with a hashed link?
ojeytonwilliams commentedon Nov 24, 2020
@vkWeb fCC uses Auth0 for everything (including passwordless login), so that's not much use here.
I don't have a strong preference for OTP over magic links, and I don't think we should worry about the default browser issue at this stage. Also, unless I'm missing something, switching between the three options (local, magic link and OTP) would not be hard, if we want to just pick one and test it out.
pdotsani commentedon Dec 6, 2020
Hoping to move this forward, I would suggest we create a feature pr using this library and see what folks think. A passportjs library seems to be an ideal route for our mvp. Auth0 requires a little more configuration and requires a subscription I believe.
This also depends on if our email service is already available. Does anyone know the status of this? I just want to avoid overlapping work as much as possible.
allella commentedon Dec 7, 2020
@pdotsani sounds good to me. Limiting the dependencies and configuration on specific 3rd party auth services would be nice.
Jonathan is working on email and may need help from someone familiar with the framework on #428
[-]As a user I can login using my email address and password[/-][+]As a user I can login using my email address and password-less links[/+]allella commentedon Apr 22, 2021
Fran merged in #464. I thought this would auto-close, but it looks like it's still open.
Closing this, but please reopen if needed.
allella commentedon Apr 26, 2021
#583 addressed some of the remaining integration on the authentication.