Skip to content

Conversation

@AashifAmeer
Copy link
Contributor

@AashifAmeer AashifAmeer commented Mar 15, 2025

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:

  • Logging in with a username works fine.
  • Logging in with an Email ID fails because the user data is not found.

This fix ensures:

  1. ClaimsIdentity is correctly assigned with the user ID during login, regardless of whether the user logs in with an Email ID or username.
  2. The user ID is correctly retrieved from ClaimsIdentity when performing project actions.
  3. Optimized project-related queries for better performance.

Changes Made

  • Updated the login logic to assign ClaimsIdentity with the user ID instead of the username.
  • Ensured user data is correctly retrieved when logging in with an Email ID.
  • Added validation to correctly retrieve the user ID from ClaimsIdentity when performing project actions (create, update, delete).
  • Optimized project-related queries using AnyAsync for efficient existence checks.

Fixes : #95

@AashifAmeer AashifAmeer changed the title User data becomes null when logging in with email ID Fix: User data becomes null (404) when logging in with Email ID which blocks project actions Mar 15, 2025
cengique added a commit that referenced this pull request Mar 30, 2025
Merge pull request #94 "Fix: User data becomes null (404) when logging in
with Email ID which blocks project actions"
Copy link
Member

@cengique cengique left a comment

Choose a reason for hiding this comment

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

Works as intended, but deleting projects still broken.

@cengique cengique merged commit 70cf5c5 into soft-eng-practicum:develop Mar 30, 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.

User data becomes null (404) when logging in with Email ID which blocks project actions : [Fixed]

2 participants