amlan-roy / resume-craft

Resume Craft: Your go-to platform for effortlessly tailoring ATS-friendly resumes to job descriptions. Streamline your job application process and stand out in the competitive market.
https://resume-craft-ten.vercel.app
7 stars 3 forks source link

Login does not redirect on first time logging in #77

Closed amlan-roy closed 6 months ago

amlan-roy commented 7 months ago

Describe the bug

When we log in in a fresh window, logging in for the first time does not redirect to home page.

Steps To Reproduce

  1. Go to https://resume-craft-ten.vercel.app/login
  2. Login (either by google or email password)
  3. Successful login does not redirect to home page
  4. Logout
  5. Login again, and redirect works

Expected result

Should redirect in the first login attempt itself

Actual result

Does not login in the first attempt

Are you willing to contribute to this issue?

Yes

Environment Information

Desktop:

amlan-roy commented 7 months ago

Apparently, the session cookie is not being passed to the middleware from the login page in deployed environments. This is really confusing because the cookies are passed correctly in dev env.

Moreover, the cookies are being set correctly, but not passed.

I suspect that this has something to do with Edge functions (middleware runs on edge) behaviour of Nextjs/Vercel.

amlan-roy commented 6 months ago

Closing this ticket because added a temp fix. Tracking this issue in the ticket: https://github.com/amlan-roy/resume-craft/issues/91