initial rebuild from v1

This commit is contained in:
2021-04-22 22:31:23 +02:00
commit cc8cf4954d
152 changed files with 11559 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
class ApplicationController < ActionController::Base
around_action :switch_locale
def switch_locale(&action)
locale = I18n.default_locale
I18n.with_locale(locale, &action)
end
def new_session_path(_scope)
new_user_session_path
end
end

View File

View File

@@ -0,0 +1,4 @@
class HomeController < ApplicationController
def index
end
end

View File

@@ -0,0 +1,24 @@
# frozen_string_literal: true
# Controller: Callback
#
# Description: Callback method for Bnet
class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
skip_before_action :verify_authenticity_token, only: :bnet
def bnet
@user = User.from_omniauth(request.env['omniauth.auth'])
if @user.persisted?
sign_in_and_redirect @user, event: :authentication
set_flash_message(:notice, :success, kind: 'Bnet') if is_navigational_format?
else
session['devise.bnet_data'] = request.env['omniauth.auth'].except(:extra)
redirect_to new_user_registration_url
end
end
def failure
redirect_to root_path
end
end