[openstreetmap/openstreetmap-website] Re-arrange login and signup screens as discussed in #4128 (PR #4455)
Tom Hughes
notifications at github.com
Tue Feb 6 19:10:04 UTC 2024
@tomhughes commented on this pull request.
> @@ -290,8 +241,23 @@ def auth_success
else
failed_login t("sessions.new.auth failure")
end
+ elsif user.nil? && user = User.find_by(:email => email)
+ user[:auth_uid] = uid
+ user[:auth_provider] = provider
+ user.save!
+
+ user.deactivate! if user.status == "active" && !email_verified
+
+ if user.status == "active"
+ successful_login(user)
+ else
+ session[:token] = user.tokens.create.token
+ UserMailer.signup_confirm(user, user.tokens.create(:referer => session[:referer])).deliver_later
+ redirect_to :controller => :confirmations, :action => :confirm, :display_name => user.display_name
+ end
Yes that is certainly the simplest solution, and removes the problems with the current code.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4455#discussion_r1480418445
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/4455/review/1866120993 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240206/21e7f0c9/attachment.htm>
More information about the rails-dev
mailing list