-
Notifications
You must be signed in to change notification settings - Fork 1
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
Consolidate API requests authed with bearer to a single function call #279
Conversation
Also finally fixes problems with logout not being communicated to Ground Truth
34c1cd1
to
1502ab6
Compare
|
||
req.end(); | ||
// Invalidates token and logs user out of Ground Truth too | ||
await GroundTruthStrategy.apiRequest("POST", new URL("/api/user/logout", groundTruthURL).toString(), user.token || ""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to log the user out of GT if they log out of registration? CAS (ie login.gatech.edu) would typically keep you logged in but redirect you to a page that gives you the option to completely log out of the CAS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I implemented it this way because typically people want to sign out of registration + Ground Truth (i.e. to switch accounts or for security or whatever) when they click "Log out" from within registration and combining it into a single, automatic step seemed easier. I don't really see a use case for wanting to log out of registration but not Ground Truth
server/routes/strategies.ts
Outdated
reject(error); | ||
} | ||
else { | ||
resolve(body as string); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have some endpoints that don't return JSON?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point - updated method to always return parsed JSON
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Consolidate API requests authed with bearer to a single function call
Also finally fixes problems with logout not being communicated to Ground Truth
A continuation of #276