-
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
[TC-0059] Auth Guard #16
Conversation
chelsea-EYDS
commented
Dec 16, 2023
- Checking auth token on all routes that are not annotated with the public decorator
- Validating auth token
- Checking Reflector to see if route is annotated with a Roles decorator
- Validating user assigned role if the current route requires a role
90b8e82
to
d363026
Compare
throw new UnauthorizedException(); | ||
} | ||
|
||
//YODO check expiry |
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 would be pretty trivial, no?
backend/src/auth/auth.guard.ts
Outdated
throw new UnauthorizedException(); | ||
} | ||
|
||
if (payload.aud !== 'account') { |
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 seems like the wrong thing to check? I think authorized party is the thing to check azp
import { SetMetadata } from '@nestjs/common'; | ||
import { Metadata } from './metadata'; | ||
|
||
export const Public = () => SetMetadata(Metadata.IS_PUBLIC, true); |
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.
can we change to PUBLIC_ENDPOINT
just for clarity