diff --git a/app/controllers/auth/confirmations_controller.rb b/app/controllers/auth/confirmations_controller.rb index 3123285d7..0eafb4cf5 100644 --- a/app/controllers/auth/confirmations_controller.rb +++ b/app/controllers/auth/confirmations_controller.rb @@ -5,7 +5,6 @@ class Auth::ConfirmationsController < Devise::ConfirmationsController yield resource if block_given? if resource.errors.empty? - set_flash_message!(:notice, :confirmed) if resource.sign_in_count.zero? token = resource.send(:set_reset_password_token) redirect_to controller: "auth/passwords", action: "edit", reset_password_token: token, confirmation: true diff --git a/app/models/user.rb b/app/models/user.rb index 3badcdd5d..cdb958822 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -86,7 +86,7 @@ class User < ApplicationRecord end def skip_confirmation! - !user.active? + !active? end def need_two_factor_authentication?(_request) diff --git a/spec/features/organisation_spec.rb b/spec/features/organisation_spec.rb index a88114077..ef54ff2a2 100644 --- a/spec/features/organisation_spec.rb +++ b/spec/features/organisation_spec.rb @@ -13,7 +13,7 @@ RSpec.describe "User Features" do before do allow(DeviseNotifyMailer).to receive(:new).and_return(devise_notify_mailer) allow(devise_notify_mailer).to receive(:notify_client).and_return(notify_client) - allow(Devise.token_generator).to receive(:generate).and_return(confirmation_token) + allow(Devise).to receive(:friendly_token).and_return(confirmation_token) allow(notify_client).to receive(:send_email).and_return(true) sign_in user end