Hello friends! Made a sweet and sleek OTP input. 100% Free.
I noticed there were other options, but not as responsive or flexible. I wanted to make one on my own without any libraries, so I used my own Javascript and CSS to do-so. This was solely intended for private use on a client but wanted to make it public.
Awesome. Im trying to make a passwordless flow for customers similar to a lot of newer apps. They just text you a code now. I havent figured out how to do this in bubble as a way to stay logged in.
You can just email a magic link. OR save the link, and setup a workflow when a valid code is achieved, then navigate the user to that link.
I haven’t tried that method yet but I’d assume it would work.
Hell… maybe I’ll just do that for my own app.
My goal right now is to allow users to login with two methods (requires at least one).
SMS - sends a code to them anytime they make a change to their account or security info | users need a password still to login, but after they login, they are locked until they validate the code I generate
Email - when a user tries to login and their account is set to email, it will send them a magic login link OR a code to login. If they use the magic link from the email, all is good. But here is where passwordless comes into play.
The logic:
Save the magic link when they hit the button, and generate a code at the same time. Change a state on the page to allow them to input a code or tell them to click the link they got from their email.
Send an email with the magic link and the code.
If they click on the magic link, no problems there.
If they want to enter the code in, the same logic I explained above with matching emails and codes will apply. We will create a backend API workflow that will validate the code they enter, and the email address they have on the current page (they’ll require another code if they leave the page – can introduce session based logic as well later on).
if the code is right, then push them to the URL that you have saved from earlier generated from the Magic link action.
With this logic in place, you should theoretically be able to setup passwordless with email.
Hmm… i see. So basically its still a magic link but the ux only knows theyre entering the code sent to them. Id like it to send a text as soon as page loads.