-
Notifications
You must be signed in to change notification settings - Fork 2
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
fetch-apis-assigned-to-company #94
Conversation
companyId?: string, | ||
) { | ||
const company = await this.companyRepository.findOneOrFail({ | ||
where: { id: companyId ?? ctx.activeCompany.id }, |
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.
you should check if the current user is an api provider before fetching by companyId, dont want anyone to supply an id and be able to fetch data unrelated to them
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.
Actually the service would serve 2 different endpoints. Forgot while I worked
@@ -88,6 +88,21 @@ export class APIController { | |||
); | |||
} | |||
|
|||
@Put('company/:companyId') | |||
@UsePipes(IValidationPipe) | |||
@RequireTwoFA() |
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 means users would need to provide a 2fa code to access this endpoint, dont think its idle for a get request, also seeing you doing a Put instead of Get
No description provided.