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

Implement gracefall fallback if curator_self authorization fails #471

Open
paulalbert1 opened this issue Oct 16, 2023 · 0 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@paulalbert1
Copy link
Contributor

paulalbert1 commented Oct 16, 2023

A user was trying to login to Publication Manager. She had roles of 3 and 4 in admin_users_roles (curator_self and reporter_all).

Of these, the curator_self role was wrong apparently. The user was in the person table but not the person_article table.

I'm not sure why this happened. In any case, we shouldn't prevent such users from logging in, in cases where a user has another role like reporter_all. I suggest that in these cases, instead of showing an error page, we gracefully direct properly authenticated users to the "Find People" page.

Screenshot 2023-10-16 at 2 34 48 PM

Here's the error in the logs:

ReCiter Update Goldstandard api is not reachable: FetchError: invalid json response body at https://reciter.weill.cornell.edu/reciter/goldstandard?goldStandardUpdateFlag=UPDATE reason: Unexpected token < in JSON at position 0
RangeError [ERR_HTTP_INVALID_STATUS_CODE]: Invalid status code: undefined
    at ServerResponse.writeHead (_http_server.js:255:11)
    at ServerResponse.writeHead (/app/node_modules/next/dist/compiled/compression/index.js:46:263)
    at ServerResponse._implicitHeader (_http_server.js:246:8)
    at ServerResponse.end (/app/node_modules/next/dist/compiled/compression/index.js:22:749)
    at ServerResponse.apiRes.end (/app/node_modules/next/dist/server/api-utils/node.js:346:25)
    at sendData (/app/node_modules/next/dist/server/api-utils/node.js:187:9)
    at ServerResponse.apiRes.send (/app/node_modules/next/dist/server/api-utils/node.js:349:31)
    at handler (/app/.next/server/pages/api/reciter/update/goldstandard.js:88:52)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async Object.apiResolver (/app/node_modules/next/dist/server/api-utils/node.js:366:9)
    at async NextNodeServer.runApi (/app/node_modules/next/dist/server/next-server.js:481:9)
    at async Object.fn (/app/node_modules/next/dist/server/next-server.js:741:37)
    at async Router.execute (/app/node_modules/next/dist/server/router.js:252:36)
    at async NextNodeServer.run (/app/node_modules/next/dist/server/base-server.js:365:29)
    at async NextNodeServer.handleRequest (/app/node_modules/next/dist/server/base-server.js:303:20) {
  code: 'ERR_HTTP_INVALID_STATUS_CODE'
}
@paulalbert1 paulalbert1 added the bug Something isn't working label Oct 16, 2023
@paulalbert1 paulalbert1 changed the title Implement gracefall fallback if authorization fails Implement gracefall fallback if curator_self authorization fails Oct 16, 2023
@mrj4001 mrj4001 self-assigned this Apr 4, 2024
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

2 participants