Skip to content

188 auth4#236

Open
SamNie2027 wants to merge 11 commits intomainfrom
188-auth4
Open

188 auth4#236
SamNie2027 wants to merge 11 commits intomainfrom
188-auth4

Conversation

@SamNie2027
Copy link
Copy Markdown
Collaborator

@SamNie2027 SamNie2027 commented Apr 5, 2026

ℹ️ Issue

Closes #188

📝 Description

Backend Auth Flow
https://miro.com/app/board/uXjVGncnqBo=/?share_link_id=506205508201
image

Frontend:
When the frontend needs userType to do frontend-side role guard, it gets the userType cached from storage. If this doesn't exist it gets it from the frontend.
It clears out every time the user logs out.
Also, the frontend interacts directly with Cognito to do login, signin, signup, ect. It interacts with the backend when it needs additional backend data, and the backend knows the authenticity of the frontend through the JWT. The backend never accepts frontend UserType as trustworthy and always uses the JWT to pull the email directly from Cognito to then use to query database data to get the UserType.

✔️ Verification

Both Standard and Admin user login flows work.

@SamNie2027 SamNie2027 requested a review from rayyanmridha April 5, 2026 23:53
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.

Start to setup Auth using cognito and amplify

1 participant