-
-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Schema Analyzer calls don't have the refreshed token which causes 401 error #564
Comments
Issue seems to be coming from the api-doc-parser where the getParameters function is returned for each Resource with the token saved into it. Since parseHydraDocumentation is only called once when the page is loaded the JWT is never updated in the resource function call.
|
@dunglas would such a change to the getParameters callback be accepeted ? Adding a "in_options" argument to eventually override at runtime the headers that can be sent to fetch resource parameters. resource.getParameters = (in_options: RequestInitExtended = {}): Promise<Parameter[]> =>
getParameters(resource, {...options, ...in_options}); If yes then to be discussed, the schemaAnalyzer could be modified to take a new argument with the options.
Options (with Authentication headers) could then either be passed down from the FilterGuesser (and other Guessers) or (less likely I guess) fetched directly in the schemaAnalyzer (using local storage maybe ?). Unless you see another solution to have the updated tokens passed down to the getParameter requests ! |
Do you have a solution? it v4 is affected. |
#578 helped me to solve my issue. i created a custom parser where i did set the proper headers for authentication. but any better idea is wellcome. |
API Platform version(s) affected: api: 3.3, admin: 3.4.6
Description
When accessing a resource from the admin, several extra calls seem to be made on top of the main call fetching the data:
These calls seem to be initiated by the Guesser Components to fetch the schema:
These calls do include a JWT but this token is not refreshed if expired. The JWT in the "main" call is correctly updated.
How to reproduce
Possible Solution
n/a
Additional Context
parseHydraDocumentation
problem remains.The text was updated successfully, but these errors were encountered: