Fix: User data becomes null (404) when logging in with Email ID which blocks project actions #94
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes an issue where users logging in with their Email ID cannot create, update, delete projects, or perform other actions because the user data returns null (404). The issue happens because
ClaimsIdentity(which stores user information like user ID, username, or roles after log in) is assigned with the username instead of the user ID. As a result:This fix ensures:
ClaimsIdentityis correctly assigned with the user ID during login, regardless of whether the user logs in with an Email ID or username.ClaimsIdentitywhen performing project actions.Changes Made
ClaimsIdentitywith the user ID instead of the username.ClaimsIdentitywhen performing project actions (create, update, delete).AnyAsyncfor efficient existence checks.Fixes : #95