Skip to content

fix(auth): #69: guard login while a session is active - #77

Merged
imdeepmind merged 1 commit into
developfrom
#69
Aug 30, 2026
Merged

fix(auth): #69: guard login while a session is active#77
imdeepmind merged 1 commit into
developfrom
#69

Conversation

@imdeepmind

Copy link
Copy Markdown
Owner

Closes #69

Guard Service.Login against an already-active session, mirroring the existing Register guard. Previously login while signed in closed the current user's database connection via Connection.Set before the new credentials were verified, leaving a dead session on failure or silently signing out the current user on success.

  • Add ErrAlreadySignedIn sentinel in internal/shared/errors.
  • Login now returns ErrAlreadySignedIn before touching the keyring or the shared connection when session != nil.
  • Register now returns the same ErrAlreadySignedIn sentinel instead of the generic ErrInvalidInput for the same guard.

@imdeepmind
imdeepmind merged commit 412cb67 into develop Aug 30, 2026
6 checks passed
@imdeepmind
imdeepmind deleted the #69 branch August 30, 2026 11:32
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.

Guard Login while a session is already active (must logout first)

1 participant