-
Notifications
You must be signed in to change notification settings - Fork 0
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
Allow access_token as url query parameter for authentication #2
Comments
Hey, thanks for showing interest in it! I have tested it with a static_token using both the Authorization header Does the user your static token belongs to have the necessary permissions for the data you are trying to use? And did you change the code so that it fits your data models? |
Hey, what i meant with that is that the endpoint expects a data model called const footageService = new ItemsService("footage", { schema }); and this then also expects a one-to-many relation between const footage = (await footageService.readOne(primaryKey, {
fields: ["scenes.index", "scenes.footage_in", "scenes.footage_out", "file.metadata"],
deep: { scenes: { _sort: ["index"] } },
})) as Footage; This requests the footage item by id with related scenes data included. I hard coded these data models because it kinda was just a proof-of-concept and not a ready to use extension :D So this Unauthorized Error might come from one of these two data models not defined. I just tested this by renaming Let me know if this helped! So the solution would be to edit the code in the extension so that it fits the data models that you have in your directus instance and then to re-build the extension. It currently needs the following information: type Scene = {
index: number;
footage_in: number;
footage_out: number
};
type Footage = {
scenes: Scene[];
file: {
metadata: {
frame_rate: number
}
}
};
and in my case i added a frame_rate to the metadata object of a directus file. if you edit the code you might aswell save the frame_rate with a data model instead. for me it made sense to save it to the directus file on creation. |
ah thanks a lot, yes this helped, after a closer look and your explanation it is working. |
Hi @johind
Thanks for publishing this module.
I would like to ask if this is also supposed to work with static
access_token
as query param in URL?As i see for now (without digging)
access_token
does not throw an error on your app but i still get anUnauthorized
as response.The text was updated successfully, but these errors were encountered: