Add `email` param to `POST /api/v1/emails/confirmations` (#15949)
Allow changing e-mail as long as the account is unconfirmedremotes/1727458204337373841/tmp_refs/heads/signup-info-prompt
parent
f8e50eaea3
commit
dd1eb9918a
|
@ -5,7 +5,11 @@ class Api::V1::Emails::ConfirmationsController < Api::BaseController
|
||||||
before_action :require_user_owned_by_application!
|
before_action :require_user_owned_by_application!
|
||||||
|
|
||||||
def create
|
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
|
render_empty
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue