2014-10-02 12:38:26 +00:00
|
|
|
class ConfirmationsController < Devise::ConfirmationsController
|
2016-03-11 16:14:29 +00:00
|
|
|
def almost_there
|
|
|
|
flash[:notice] = nil
|
|
|
|
render layout: "devise_empty"
|
|
|
|
end
|
|
|
|
|
2014-10-02 12:38:26 +00:00
|
|
|
protected
|
|
|
|
|
2016-03-11 16:14:29 +00:00
|
|
|
def after_resending_confirmation_instructions_path_for(resource)
|
|
|
|
users_almost_there_path
|
|
|
|
end
|
|
|
|
|
2017-10-24 06:23:35 +00:00
|
|
|
def after_confirmation_path_for(resource_name, resource)
|
2017-09-04 17:23:33 +00:00
|
|
|
# incoming resource can either be a :user or an :email
|
|
|
|
if signed_in?(:user)
|
2017-09-21 08:29:09 +00:00
|
|
|
after_sign_in(resource)
|
2014-10-02 12:38:26 +00:00
|
|
|
else
|
2017-10-27 14:32:48 +00:00
|
|
|
Gitlab::AppLogger.info("Email Confirmed: username=#{resource.username} email=#{resource.email} ip=#{request.remote_ip}")
|
2016-11-15 01:30:12 +00:00
|
|
|
flash[:notice] += " Please sign in."
|
2018-01-01 22:43:16 +00:00
|
|
|
new_session_path(:user, anchor: 'login-pane')
|
2014-10-02 12:38:26 +00:00
|
|
|
end
|
|
|
|
end
|
2017-09-21 08:29:09 +00:00
|
|
|
|
|
|
|
def after_sign_in(resource)
|
|
|
|
after_sign_in_path_for(resource)
|
|
|
|
end
|
2014-10-02 12:38:26 +00:00
|
|
|
end
|