-
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
Mpi auth #36
base: main
Are you sure you want to change the base?
Mpi auth #36
Conversation
Coverage report
Show new covered files 🐣
Test suite run success4 tests passing in 2 suites. Report generated by 🧪jest coverage report action from e728551 |
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.
It looks good, I added some suggestions to keep the code base cohesive
|
||
type eLabsStatus = 'PENDING' | 'PROGRESS' | 'COMPLETED'; | ||
|
||
@Controller('mpi') |
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.
Is there a reason this is written using REST instead of GraphQL?
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 suppose just to reflect the MPI backend
|
||
@Injectable() | ||
export class MPIService { | ||
private tokenStore = new Map<string, { accessToken: string; refreshToken: string; accessTokenExpiration: Date }>(); |
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.
This should probably be within MongoDB since we already have everything setup for it
const user = this.tokenStore.get(this.currentUserId); | ||
if (user && user.accessToken && user.accessTokenExpiration) { | ||
if (user.accessTokenExpiration > new Date(Date.now())) { | ||
console.log('user ', user, ' has valid 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.
Best to avoid having left over console.log
s
Description
Checklist