Skip to content
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

Author requests aren't properly authorised #425

Closed
thewilkybarkid opened this issue Nov 11, 2021 · 0 comments
Closed

Author requests aren't properly authorised #425

thewilkybarkid opened this issue Nov 11, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@thewilkybarkid
Copy link
Member

The authorisation logic for author requests is broken: any user can request one. Following the upgrade to Node 16 (#421), the app actually now crashes (due to an unhandled promise rejection).

@thewilkybarkid thewilkybarkid added the bug Something isn't working label Nov 11, 2021
thewilkybarkid added a commit that referenced this issue Nov 11, 2021
This change adds test cases for creating an author review which shows the app fails.

Refs #388, #425
thewilkybarkid added a commit that referenced this issue Nov 11, 2021
CI started to fail with database connection problems; I could recreate this locally using Jest's --runInBand option. For an unknown reason, it doesn't like persisting data in the beforeAll step when only using a single worker.

As a result, I've had to create these groups explicitly when needed.

Refs 31ff753, #388, #425
thewilkybarkid added a commit that referenced this issue Nov 11, 2021
This change adds missing await statements. This change doesn't fix the skipped tests, only changing the result from a crash application to a 500 response.

Refs #425
thewilkybarkid added a commit that referenced this issue Nov 11, 2021
The thisUser.isMemberOf function expects a user's ID rather than a persona. Worse, authorPersona is an ORM reference to the persona rather than the persona itself, so the uuid property is undefined. This change fixes the argument, resulting in passing tests.

Refs #425
thewilkybarkid added a commit that referenced this issue Nov 12, 2021
When creating a new request, the API currently doesn't return any information when it succeeds. This change adds the request itself to the response, so the user doesn't have to look it up separately. This also then matches other endpoints.

Refs #425
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant