mirror of
https://github.com/internetee/registry.git
synced 2025-08-03 08:22:05 +02:00
24 lines
466 B
Ruby
24 lines
466 B
Ruby
class Registrar
|
|
class TaraController < ApplicationController
|
|
skip_authorization_check
|
|
|
|
def callback
|
|
session[:omniauth_hash] = user_hash
|
|
@api_user = ApiUser.from_omniauth(user_hash)
|
|
|
|
return unless @api_user
|
|
|
|
sign_in_and_redirect(:registrar_user, @api_user)
|
|
end
|
|
|
|
def cancel
|
|
redirect_to root_path, notice: t(:sign_in_cancelled)
|
|
end
|
|
|
|
private
|
|
|
|
def user_hash
|
|
request.env['omniauth.auth']
|
|
end
|
|
end
|
|
end
|