about summary refs log tree commit diff
path: root/app/controllers/api
diff options
context:
space:
mode:
authorStarfall <us@starfall.systems>2021-04-02 15:04:35 -0500
committerStarfall <us@starfall.systems>2021-04-02 15:04:35 -0500
commitaeb0f34cefd88caaaa51e8250e1f6ddde280c4bb (patch)
tree15dafdc2cdfd9e78e72e461440b593c3fc89788e /app/controllers/api
parent0f7be4b48947a9edcbb6fb84d5d0fd9150ee0870 (diff)
parentb7ec2a900251410c65ba214b50c1657209285b07 (diff)
Merge branch 'glitch'
Diffstat (limited to 'app/controllers/api')
-rw-r--r--app/controllers/api/v1/emails/confirmations_controller.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/api/v1/emails/confirmations_controller.rb b/app/controllers/api/v1/emails/confirmations_controller.rb
index 03ab5de8c..4a7aa9c32 100644
--- a/app/controllers/api/v1/emails/confirmations_controller.rb
+++ b/app/controllers/api/v1/emails/confirmations_controller.rb
@@ -5,7 +5,11 @@ class Api::V1::Emails::ConfirmationsController < Api::BaseController
   before_action :require_user_owned_by_application!
 
   def create
-    current_user.resend_confirmation_instructions if current_user.unconfirmed_email.present?
+    if !current_user.confirmed? && current_user.unconfirmed_email.present?
+      current_user.update!(email: params[:email]) if params.key?(:email)
+      current_user.resend_confirmation_instructions
+    end
+
     render_empty
   end