Answer the question
In order to leave comments, you need to log in
Devise: How to disable autologin after registration?
Compared to out-of-the-box functionality, registration has changed a bit. The bottom line is this: for registration, only the email is entered, to which the generated password is sent. Everything is fine, except that after sending mail with a password, login occurs automatically, which must be removed.
The code responsible for registration is standard. Where to dig?
yield resource if block_given?
if resource.persisted?
if resource.active_for_authentication?
set_flash_message! :notice, :signed_up
sign_up(resource_name, resource)
respond_with resource, location: after_sign_up_path_for(resource)
else
set_flash_message! :notice, :"signed_up_but_#{resource.inactive_message}"
expire_data_after_sign_in!
respond_with resource, location: after_inactive_sign_up_path_for(resource)
end
else
clean_up_passwords resource
set_minimum_password_length
respond_with resource
end
Answer the question
In order to leave comments, you need to log in
Just comment out sign_up. This method just calls sign_in
https://github.com/plataformatec/devise/blob/maste...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question