Skip to content

Commit

Permalink
Fix educonnect callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
pierrax committed Jan 23, 2025
1 parent c613b1e commit 51f87f6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/controllers/callbacks_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def fim
end

def educonnect
return unless cookies[:state] == params[:state]
redirect_to root_path, alert: 'Jeton invalide' and return unless cookies[:state] == params[:state]

code = params[:code]
state = params[:state]
Expand All @@ -55,7 +55,8 @@ def educonnect
student.confirmed_at = Time.now
student.save

sign_in_and_redirect student, event: :authentication
sign_in(student)
redirect_to after_sign_in_path_for(student), notice: 'Vous êtes bien connecté'
end

def get_role(role)
Expand Down

0 comments on commit 51f87f6

Please sign in to comment.