Skip to content

Commit

Permalink
update callback controller
Browse files Browse the repository at this point in the history
  • Loading branch information
kcinay055679 committed Feb 29, 2024
1 parent e2bbafe commit ff014aa
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions app/controllers/omniauth_callbacks_controller.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
class OmniauthCallbacksController < Devise::OmniauthCallbacksController
skip_before_action :verify_authenticity_token, only: :openid_connect

def openid_connect
@user = Person.from_omniauth(request.env['omniauth.auth'])
@user.save
sign_in_and_redirect @user, event: :authentication # this will throw if @user is not activated
set_flash_message(:notice, :success, kind: 'Keycloak') if is_navigational_format?
if @user.persisted?
sign_in_and_redirect @user, event: :authentication # this will throw if @user is not activated
set_flash_message(:notice, :success, kind: 'Keycloak') if is_navigational_format?
else
failure
end
end

def failure
Expand Down

0 comments on commit ff014aa

Please sign in to comment.