forked from External/greenlight
Revert "Notify admins when a approval/invite user signs up"
This reverts commit 251d85d88a
.
This commit is contained in:
@ -18,7 +18,6 @@
|
||||
|
||||
class SessionsController < ApplicationController
|
||||
include Registrar
|
||||
include Emailer
|
||||
|
||||
skip_before_action :verify_authenticity_token, only: [:omniauth, :fail]
|
||||
|
||||
@ -50,24 +49,18 @@ class SessionsController < ApplicationController
|
||||
begin
|
||||
@auth = request.env['omniauth.auth']
|
||||
@user_exists = check_user_exists
|
||||
|
||||
|
||||
# If using invitation registration method, make sure user is invited
|
||||
return redirect_to root_path, flash: { alert: I18n.t("registration.invite.no_invite") } unless passes_invite_reqs
|
||||
|
||||
|
||||
user = User.from_omniauth(@auth)
|
||||
|
||||
# Add pending role if approval method and is a new user
|
||||
if approval_registration && !@user_exists
|
||||
user.add_role :pending
|
||||
|
||||
# Inform admins that a user signed up if emails are turned on
|
||||
send_approval_user_signup_email(user) if Rails.configuration.enable_email_verification
|
||||
|
||||
return redirect_to root_path, flash: { success: I18n.t("registration.approval.signup") }
|
||||
end
|
||||
|
||||
send_invite_user_signup_email(user) if Rails.configuration.enable_email_verification && invite_registration && !@user_exists
|
||||
|
||||
login(user)
|
||||
rescue => e
|
||||
logger.error "Error authenticating via omniauth: #{e}"
|
||||
|
Reference in New Issue
Block a user