add ENV to filter authorized users

This commit is contained in:
2021-05-03 18:10:46 +02:00
parent 1533f539da
commit bb6b5e3362
3 changed files with 8 additions and 0 deletions

View File

@@ -11,6 +11,11 @@ module Users
@user = User.from_omniauth(request.env['omniauth.auth'])
if @user.persisted?
unless ENV['ALLOWED_BNET_USERS'].split(',').include?(@user.battletag)
set_flash_message(:alert, :not_authorized)
redirect_to root_path
return
end
sign_in_and_redirect @user, event: :authentication
WowCharactersWorker.perform_async(@user.id)
WowMountsCollectionWorker.perform_async(@user.id)