Destroy previous auths on new auth request
This commit is contained in:
parent
da766d8e8b
commit
80cbc7d915
1 changed files with 6 additions and 0 deletions
|
|
@ -10,6 +10,12 @@ module Api
|
||||||
|
|
||||||
def new
|
def new
|
||||||
auth = Api::OpenidConnect::Authorization.find_by_client_id_and_user(params[:client_id], current_user)
|
auth = Api::OpenidConnect::Authorization.find_by_client_id_and_user(params[:client_id], current_user)
|
||||||
|
if auth
|
||||||
|
auth.o_auth_access_tokens.destroy_all
|
||||||
|
auth.id_tokens.destroy_all
|
||||||
|
auth.code_used = false
|
||||||
|
auth.save
|
||||||
|
end
|
||||||
if logged_in_before?(params[:max_age])
|
if logged_in_before?(params[:max_age])
|
||||||
reauthenticate
|
reauthenticate
|
||||||
elsif params[:prompt]
|
elsif params[:prompt]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue