Skip to content

fix(auth): redirect expired sessions to the login page#352

Open
sujitha-kotyada wants to merge 1 commit into
Canopus-Labs:mainfrom
sujitha-kotyada:fix/issue-345-auth-redirect
Open

fix(auth): redirect expired sessions to the login page#352
sujitha-kotyada wants to merge 1 commit into
Canopus-Labs:mainfrom
sujitha-kotyada:fix/issue-345-auth-redirect

Conversation

@sujitha-kotyada

Copy link
Copy Markdown

📝 Pull Request Description

Related Issue

Closes #345

Summary

This PR fixes the authentication redirect behavior when a user's session expires.

Previously, the global Axios response interceptor redirected users to the landing page (/) after receiving a 401 Unauthorized response. This required users to manually navigate back to the login page to authenticate again.

This change updates the redirect target to /login while preserving the existing token cleanup logic. No other authentication or logout behavior has been modified.


Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature
  • ♻️ Refactoring
  • 📝 Documentation update
  • 🎨 UI/UX improvement
  • 🔥 Other(please describe) ______

How Has This Been Tested?

  • Verified that a 401 Unauthorized response now redirects users to /login instead of /.
  • Confirmed that existing token cleanup (localStorage and sessionStorage) remains unchanged.
  • Verified that the manual logout flow is unaffected.
  • Ran npm run build successfully.
  • Confirmed that the modified file introduces no new lint issues.

Screenshots (if applicable)

N/A


Checklist

  • My code follows the project's guidelines
  • I have tested my changes
  • I have linked the related issue
  • My changes do not introduce new warnings or errors

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.

[Bug]: Expired authentication redirects users to the home page instead of the login page

1 participant