Merge pull request #7836 from betagouv/fix_broken_graphql_web_interface
fix(web_graphql): corrige l'authorisation d'acces au bac à sable graphql
This commit is contained in:
commit
298f223d02
1 changed files with 5 additions and 0 deletions
|
@ -8,8 +8,13 @@ class API::V2::BaseController < ApplicationController
|
|||
private
|
||||
|
||||
def context
|
||||
# new token give administrateur_id
|
||||
if api_token.administrateur?
|
||||
{ administrateur_id: api_token.administrateur_id }
|
||||
# web interface (/graphql) give current_administrateur
|
||||
elsif current_administrateur.present?
|
||||
{ administrateur_id: current_administrateur.id }
|
||||
# old token
|
||||
else
|
||||
{ token: api_token.token }
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue