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

fetch-apis-assigned-to-company #94

Merged
merged 5 commits into from
Jan 19, 2024
Merged

fetch-apis-assigned-to-company #94

merged 5 commits into from
Jan 19, 2024

Conversation

dami-laare
Copy link
Collaborator

No description provided.

companyId?: string,
) {
const company = await this.companyRepository.findOneOrFail({
where: { id: companyId ?? ctx.activeCompany.id },
Copy link
Collaborator

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

Copy link
Collaborator Author

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()
Copy link
Collaborator

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

@dami-laare dami-laare merged commit 775342f into main Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants