debian-mirror-gitlab/app/controllers/confirmations_controller.rb

34 lines
876 B
Ruby
Raw Normal View History

2018-12-05 23:21:45 +05:30
# frozen_string_literal: true
2015-04-26 12:48:37 +05:30
class ConfirmationsController < Devise::ConfirmationsController
2018-11-08 19:23:39 +05:30
include AcceptsPendingInvitations
2016-06-02 11:05:42 +05:30
def almost_there
flash[:notice] = nil
render layout: "devise_empty"
end
2015-04-26 12:48:37 +05:30
protected
2016-06-02 11:05:42 +05:30
def after_resending_confirmation_instructions_path_for(resource)
users_almost_there_path
end
2015-04-26 12:48:37 +05:30
def after_confirmation_path_for(resource_name, resource)
2018-11-08 19:23:39 +05:30
accept_pending_invitations
2018-03-17 18:26:18 +05:30
# incoming resource can either be a :user or an :email
if signed_in?(:user)
after_sign_in(resource)
2015-04-26 12:48:37 +05:30
else
2018-03-17 18:26:18 +05:30
Gitlab::AppLogger.info("Email Confirmed: username=#{resource.username} email=#{resource.email} ip=#{request.remote_ip}")
2018-12-05 23:21:45 +05:30
flash[:notice] = flash[:notice] + " Please sign in."
2018-03-17 18:26:18 +05:30
new_session_path(:user, anchor: 'login-pane')
2015-04-26 12:48:37 +05:30
end
end
2018-03-17 18:26:18 +05:30
def after_sign_in(resource)
after_sign_in_path_for(resource)
end
2015-04-26 12:48:37 +05:30
end