Skip to content

Commit 0e9d1de

Browse files
authored
Fix unconfirmed user alert message (#94)
1 parent 0416b6f commit 0e9d1de

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ class SessionsController < ApplicationController
513513
@user = User.find_by(email: params[:user][:email].downcase)
514514
if @user
515515
if @user.unconfirmed?
516-
redirect_to new_confirmation_path, alert: "Incorrect email or password."
516+
redirect_to new_confirmation_path, alert: "Please confirm your email first."
517517
elsif @user.authenticate(params[:user][:password])
518518
login @user
519519
redirect_to root_path, notice: "Signed in."
@@ -1283,7 +1283,7 @@ class SessionsController < ApplicationController
12831283
@user = User.authenticate_by(email: params[:user][:email].downcase, password: params[:user][:password])
12841284
if @user
12851285
if @user.unconfirmed?
1286-
redirect_to new_confirmation_path, alert: "Incorrect email or password."
1286+
redirect_to new_confirmation_path, alert: "Please confirm your email first."
12871287
else
12881288
after_login_path = session[:user_return_to] || root_path
12891289
login @user

app/controllers/sessions_controller.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ def create
66
@user = User.authenticate_by(email: params[:user][:email].downcase, password: params[:user][:password])
77
if @user
88
if @user.unconfirmed?
9-
redirect_to new_confirmation_path, alert: "Incorrect email or password."
9+
redirect_to new_confirmation_path, alert: "Please confirm your email first."
1010
else
1111
after_login_path = session[:user_return_to] || root_path
1212
active_session = login @user

test/controllers/sessions_controller_test.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class SessionsControllerTest < ActionDispatch::IntegrationTest
6868
password: @unconfirmed_user.password
6969
}
7070
}
71-
assert_equal "Incorrect email or password.", flash[:alert]
71+
assert_equal "Please confirm your email first.", flash[:alert]
7272
assert_nil current_user
7373
assert_redirected_to new_confirmation_path
7474
end

0 commit comments

Comments
 (0)