Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reuse Existing Session from Secure Storage Instead of Re-Logging In #51

Closed
tsutsu3 opened this issue Dec 10, 2024 · 0 comments · Fixed by #42
Closed

Reuse Existing Session from Secure Storage Instead of Re-Logging In #51

tsutsu3 opened this issue Dec 10, 2024 · 0 comments · Fixed by #42
Labels
enhancement New feature or request v6
Milestone

Comments

@tsutsu3
Copy link
Owner

tsutsu3 commented Dec 10, 2024

Description

Currently, when a user logs in, a new session is created even if a valid session already exists in secure storage.
To improve user experience and reduce unnecessary resource usage, the system should check for an existing session during login and reuse it if valid, avoiding redundant re-authentication.

Motivation

  • Resource Optimization: Reduce server-side resource usage by reusing existing sessions.
  • Consistency: Ensures seamless transitions for users who restart the application or browser.

Proposed Solution

  1. Check for Existing Session

    • During login, check secure storage (e.g., localStorage, sessionStorage, or a secure cookie) for an existing session token.
    • Validate the token against the server to ensure it is still active and has not expired.
  2. Reuse the Session

    • If a valid session is found, bypass the login process and directly authenticate the user using the existing session.
  3. Fallback to Login

    • If no valid session exists, proceed with the standard login process to create a new session.
@tsutsu3 tsutsu3 added enhancement New feature or request v6 labels Dec 10, 2024
@tsutsu3 tsutsu3 added this to the v0.1.0 milestone Dec 10, 2024
@tsutsu3 tsutsu3 linked a pull request Dec 10, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request v6
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant