We’re making an internal app to save employee photos and other public meta data. We’d like people to register with their email address only and immediately be logged in. How do I log them in after registration without a password? I assume I need to create a strategy like :login_without_password but I’m stuck on the autologin part.
When you say “immediately logged in”, you mean without confirming the email or anything? So this is locked behind a VPN?
Yes, correct.
Gotcha. In that case, yes you’d want to make your own strategy. The success/4
callback in the AuthController
that you create is where the user is logged in automatically using password authentication. It should work the same for your custom strategy, once they are authenticated, the success callback gets called and you’re off to the races.
I’ll also be adding in the next week or two, registration with magic link. That could also be an option for you. Then all you’d need to do is add a validation on your user resource that the email address ends in @yourdomain.com