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

yihan integrate team code into the Teams page #529

Merged
merged 7 commits into from
Nov 3, 2023

Conversation

AriaYu927
Copy link
Contributor

@AriaYu927 AriaYu927 commented Sep 6, 2023

Description

截屏2023-09-06 09 22 32

This is the 3rd PR of "Create editable 4-letter team code option" task.

Related PRS (if any):

To test this backend PR you need to checkout the #1266 frontend PR.

Main changes explained:

  • Update file team.js and teamController.js for adding teamCode property to team object.

How to test:

  1. check into current branch on both frontend and backend.
  2. do npm run build and npm start to run this PR locally
  3. follow test steps in #1266

Copy link

@DavidC0126 DavidC0126 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I left my comment on FE PR#1266.

Copy link
Contributor

@Haoj1 Haoj1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AriaYu927 Great job. Comment is left in #1266

@iTvX
Copy link

iTvX commented Sep 7, 2023

I left my comment on FE

Copy link
Contributor

@GaryB93 GaryB93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with FE PR#1266. Great work!

Copy link

@winghojackyli winghojackyli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @AriaYu927 , I've tested the PR and it worked as intended with the frontend. Comment with video left here: OneCommunityGlobal/HighestGoodNetworkApp#1266 (review)

Copy link

@vikrambadhan vikrambadhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I've tested the PR and it works as intended with the frontend #1266

Copy link
Contributor

@Shiwani99 Shiwani99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,
Good Job. Left comments at frontend PR#1266

@wantingxu7
Copy link
Contributor

Hi, tested and commented on FE #1266

Copy link

@KurtisIvey KurtisIvey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No checks on the backend as to whether the user profile is an owner when trying to change the team code.

I'm able to change team codes to whatever I want to via postman despite using the auth token of an Admin user. From my understanding, only an Owner role should be able to do this .In addition, If the digits for the team code are explicitly stated to be 4 digits, you should have some sort of validation for that.

Would love to also see that sanitizing, validation, and escaping is performed on these inputs in the backend.

pr1266 no backend check for owner status when changing team code

@Lin1404 Lin1404 self-requested a review October 6, 2023 23:42
@Lin1404
Copy link
Contributor

Lin1404 commented Oct 6, 2023

Hi,
Good Job. Left comments at frontend PR#1266

Copy link
Contributor

@StrawberryCalpico StrawberryCalpico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi I just reviewed you PR, more details in Frontend #1266

Copy link

@malikjahanzaib malikjahanzaib left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @AriaYu927, I have reviewed this PR and it seems to work as intended. Detailed review on FE PR #1266. Great work!!!

@AriaYu927
Copy link
Contributor Author

No checks on the backend as to whether the user profile is an owner when trying to change the team code.

I'm able to change team codes to whatever I want to via postman despite using the auth token of an Admin user. From my understanding, only an Owner role should be able to do this .In addition, If the digits for the team code are explicitly stated to be 4 digits, you should have some sort of validation for that.

Would love to also see that sanitizing, validation, and escaping is performed on these inputs in the backend.

pr1266 no backend check for owner status when changing team code

Hi @KurtisIvey , this PR has been updated, please check when you get a chance. Thank you!

@RheaWu1212
Copy link
Contributor

Great job. Comment is left in #1266

@AriaYu927 AriaYu927 requested a review from KurtisIvey October 25, 2023 03:31
src/controllers/teamController.js Show resolved Hide resolved
src/models/team.js Show resolved Hide resolved
Copy link

@KurtisIvey KurtisIvey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic job!

I'm no longer able to force a team code edit through postman, so the backend is now catching unauthorized user roles. Everything functions as intended. Admin and lower accounts cannot edit due to inactive input and my owner account can without issue.

Screenshot 2023-11-02 at 9 39 50 PM
Screenshot 2023-11-02 at 9 37 55 PM
Screenshot 2023-11-02 at 9 37 33 PM

@one-community one-community merged commit 52be2b9 into development Nov 3, 2023
3 checks passed
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.