Skip to content

148 setup aws roles ben#215

Merged
prooflesben merged 17 commits intomainfrom
148-setup-aws-roles-ben
Nov 24, 2025
Merged

148 setup aws roles ben#215
prooflesben merged 17 commits intomainfrom
148-setup-aws-roles-ben

Conversation

@prooflesben
Copy link
Collaborator

@prooflesben prooflesben commented Nov 12, 2025

ℹ️ Issue

Closes

📝 Description

Write a short summary of what you added. Why is it important? Any member of C4C should be able to read this and understand your contribution -- not just your team members.

  1. Added backend routes to change the status of a user
  2. Changed login backend route to give back the user object after a succesful login
  3. Changed register route to register a user according to the user object and make their position inactive. Also uploaded the new user object to dynamo db as inactive. Created aws cognito groups to hold different types of users
  4. Connected MyGrants to the actual user logged in using number 2.
  5. Added routes to get active and inactive users
  6. Connected User page to backend using 6.
  7. Made it so when someone registers they have to have a unique email.

Briefly list the changes made to the code:
These changes will be listed in order of what is above.

Created the changeStatus route in the user controller, also created a service method that changes the users status in cognito and reflects that change in our dynamo db table as well.

I changed the login method to return the user as a field in the json. This was just making sure that the user is in the response since it should already be in the dynamo db table.

Added in a call to amazon cognito which would put the user in the inactive amazon cognito group

Used camilas changes to the auth provider to make sure when login is called, the user gets put in the auth context. I had a little hiccup since when a object is put in the auth context it is put there as a proxy so in the actual grant page component I had to extract the actual object using mobx toJS method.

Created Routes in the backend to fetch active and inactive users. For active users I fetched the users that had the role of employee and admin.

Used the backend routes to fetch active and inactive users. Created a use effect hook which updates the store with the active and inactive users. The user page has a tenary operator which decides what list of users show this used to be mock users but it now our actual users.

Added into the register method a check that no user has the same email as the current user who is signing up.

✔️ Verification

What steps did you take to verify your changes work? These should be clear enough for someone to be able to clone the branch and follow the steps themselves.
Alot of my verification was manually making sure the page is populated. Some things like active and inactive users I changed the values in the database to get decent values to pop up. That last sentence applies to the my grants as well.
Provide screenshots of any new components, styling changes, or pages.

Test Changes

If your new feature required some test to be changed or added to fit the new functionality or changes please document these changes here.
I cahnged the login test so that it works with the changes.

🏕️ (Optional) Future Work / Notes

Did you notice anything ugly during the course of this ticket? Any bugs, design challenges, or unexpected behavior? Write it down so we can clean it up in a future ticket!
Need more consistency in the repo

Things that could be added to this pull request

  1. Connecting the change status backend
  2. Adding testing for the register, change status, inactive, and active routes.
  3. A decent code review
  4. Delete user route.
  5. Have the users be populated when someone logs in.

@prooflesben prooflesben linked an issue Nov 12, 2025 that may be closed by this pull request
Copy link
Collaborator

@lyannne lyannne left a comment

Choose a reason for hiding this comment

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

lgtm!

@prooflesben prooflesben linked an issue Nov 12, 2025 that may be closed by this pull request
Copy link
Contributor

@janekamata janekamata left a comment

Choose a reason for hiding this comment

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

  • I'm getting a User account already exists error when creating a new account
  • Loading users page seems slow compared to everything else
  • Going to users page and then clicking the My Account page puts me back to the login page; if I hit the back button after this My Grants is no longer filtered

Copy link
Contributor

@aaronashby aaronashby left a comment

Choose a reason for hiding this comment

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

In UserPositionCard.tsx (in the users folder in the frontend), I use a switch statement on the position, assuming it was a string, so I'd say to change that to UserStatus. It's a small change, but it might work better for design

Copy link
Contributor

@janekamata janekamata left a comment

Choose a reason for hiding this comment

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

Looks good

@prooflesben prooflesben merged commit fef7db0 into main Nov 24, 2025
1 check 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.

DEV - get users by status backend route Setup AWS roles(admin, employee, inactive, and deactivate)

4 participants