-
-
Notifications
You must be signed in to change notification settings - Fork 87
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
How to send magic link after user registrated #73
Comments
Did I make myself clear? Let me explain more. I would like to make the flow, from signup to signin, like slack.
Could you let me know how to do this? As far as I know, this gem has 2 flows. First: It is a pain in input twice.
Second: It is not good for security because the email might not valid.
|
Something like this... # registrations_controller.rb
include Passwordless::ControllerHelpers
def create
user = User.new(email: params[:email])
if user.save
pwless_session = build_passwordless_session(user)
pwless_session.save!
YourOwnRegistrationsMailer.signup(token: pwless_session.token).deliver_now
# ... redirect back or whatever
end
end |
Thank you for your help!! def create
@user = User.new(user_params)
respond_to do |format|
if @user.save
pwless_session = build_passwordless_session(@user)
pwless_session.save!
RegistrationMailer.with(token: pwless_session.token, user: @user).welcome_email.deliver_now
# ... redirect back or whatever
end
end |
I want you to add this way at README.md if you can. |
This is wrongI've deleted the message due to wrong content - some local issue on my machine. |
I'm not sure that's right. |
You are right, but this is a case for my small test project using your gem. I'll create a new issue with all information. |
Is there any way to send magic link after user registered like
sign_in @user
for security?The text was updated successfully, but these errors were encountered: