From e05f0b3616da8b962b763c48a2139882fd88047a Mon Sep 17 00:00:00 2001 From: Adam Cooke Date: Mon, 4 Mar 2024 14:41:18 +0000 Subject: [PATCH] fix: remove user email verification --- app/controllers/user_controller.rb | 21 +-------------------- app/mailers/app_mailer.rb | 16 ---------------- 2 files changed, 1 insertion(+), 36 deletions(-) diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 45d55ba..33363cc 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -67,30 +67,11 @@ class UserController < ApplicationController return end - email_changed = @user.email_address_changed? - if @user.save - if email_changed - redirect_to_with_json verify_path(return_to: settings_path), - notice: "Your settings have been updated successfully. As you've changed, your e-mail " \ - "address you'll need to verify it before you can continue." - else - redirect_to_with_json settings_path, notice: "Your settings have been updated successfully." - end + redirect_to_with_json settings_path, notice: "Your settings have been updated successfully." else render_form_errors "edit", @user end end - def verify - return unless request.post? - - if params[:code].to_s.strip == current_user.email_verification_token.to_s || (Rails.env.development? && params[:code].to_s.strip == "123456") - current_user.verify! - redirect_to_with_json [:return_to, root_path], notice: "Thanks - your e-mail address has been verified successfully." - else - flash_now :alert, "The code you've entered isn't correct. Please check and try again." - end - end - end diff --git a/app/mailers/app_mailer.rb b/app/mailers/app_mailer.rb index dca1d84..c8094de 100644 --- a/app/mailers/app_mailer.rb +++ b/app/mailers/app_mailer.rb @@ -2,22 +2,6 @@ class AppMailer < ApplicationMailer - def verify_email_address(user) - @user = user - mail to: @user.email_address, subject: "Verify your new e-mail address" - end - - def new_user(user) - @user = user - mail to: @user.email_address, subject: "Welcome to Postal" - end - - def user_invite(user_invite, organization) - @user_invite = user_invite - @organization = organization - mail to: @user_invite.email_address, subject: "Access the #{organization.name} organization on Postal" - end - def verify_domain(domain, email_address, user) @domain = domain @email_address = email_address