fix(web_graphql): fix graphql web playground authorization
This commit is contained in:
parent
1212727b42
commit
122c8107a5
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