Skip to content

Optimize Auth Flow by Removing Redundant /auth/me Requests#703

Open
Ashutosh-Mall wants to merge 2 commits into
aryandas2911:mainfrom
Ashutosh-Mall:feature/auth-system
Open

Optimize Auth Flow by Removing Redundant /auth/me Requests#703
Ashutosh-Mall wants to merge 2 commits into
aryandas2911:mainfrom
Ashutosh-Mall:feature/auth-system

Conversation

@Ashutosh-Mall
Copy link
Copy Markdown

📌 Description

Optimized the authentication flow by returning user data directly from the backend during signup and login. This removes the need for extra /auth/me requests after authentication and improves overall performance.

🔗 Related Issue

Closes #405

🛠 Changes Made

  • Added user object in signup API response
  • Added user object in login API response
  • Removed password field using .select("-password")
  • Removed unnecessary /auth/me API calls from frontend
  • Updated auth state handling in Login.jsx and Signup.jsx

📸 Screenshots (if applicable)

N/A

✅ Checklist

  • Code runs locally
  • Followed project structure
  • No console errors
  • Properly tested changes
  • Linked the issue

🚀 Notes for Reviewers

This PR mainly focuses on reducing redundant API requests and improving authentication response handling.

@Ashutosh-Mall
Copy link
Copy Markdown
Author

Hi @aryandas2911
Looks good overall 👍
No major issues found. Ready to merge

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.

Optimize Signup Flow by Removing Unnecessary /auth/me Request

1 participant