-
Notifications
You must be signed in to change notification settings - Fork 0
Revert "fix: construct User object from flat AuthResponse fields in auth store" #79
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -28,10 +28,7 @@ export interface RegisterRequest { | |||||||||||
|
|
||||||||||||
| export interface AuthResponse { | ||||||||||||
| token: string | ||||||||||||
| userId: number | ||||||||||||
| username: string | ||||||||||||
| email: string | ||||||||||||
| role: UserRole | ||||||||||||
| user: User | ||||||||||||
|
||||||||||||
| user: User | |
| userId: number | |
| username: string | |
| email: string | |
| role: UserRole |
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.
login()andregister()now readresponse.userand persist it. Given the backend auth endpoints currently return flat fields (nouserobject), this will setuser.valuetoundefined, store invalid JSON, and leaveisAuthenticatedfalse after a successful login/register. Consider mapping the backend response into aUser(e.g., reintroduce auserFromAuthResponsetransform or do the mapping in@/api/auth) or change the backend response to includeuser.