invite: clarify logic of sign-up redirection

This commit is contained in:
Pierre de La Morinerie 2018-09-18 14:18:58 +00:00
parent a63e035daf
commit bc55afba51

View file

@ -1,7 +1,10 @@
class Users::Dossiers::InvitesController < UsersController
def authenticate_user!
session["user_return_to"] = request.fullpath
return redirect_to new_user_registration_path(user_email: params[:email]) if params[:email].present? && User.find_by(email: params[:email]).nil?
if params[:email].present? && User.find_by(email: params[:email]).nil?
return redirect_to new_user_registration_path(user_email: params[:email])
end
super
end