Skip to content

Best way to implement a manually triggered task #1090

Answered by michaelbromley
skid asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, you can apply the Allow decorator to a Controller method. I just updated the doc block to state this.

Auth is handled in the exact same way for REST as with GraphQL - either bearer token or cookie depending on your config. You can see the e2e tests that verify this here:

it('permission-restricted route forbidden', async () => {
const response = await shopClient.fetch(restControllerUrl + '/restricted');
expect(response.status).toBe(403);
const result = await response.json();
expect(result.message).toContain('FORBIDDEN');
});
it('permission-restricted route forbidden …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by skid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants