Skip to content

ensure inactive users cannot log in and restrict actions for non-admi…#601

Merged
rajnandan1 merged 1 commit intomainfrom
fix/privilage-1
Feb 24, 2026
Merged

ensure inactive users cannot log in and restrict actions for non-admi…#601
rajnandan1 merged 1 commit intomainfrom
fix/privilage-1

Conversation

@rajnandan1
Copy link
Owner

…n roles. Fixes #600

Copilot AI review requested due to automatic review settings February 24, 2026 18:32
@rajnandan1 rajnandan1 merged commit bb5d58b into main Feb 24, 2026
2 checks passed
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Closes issue #600 by tightening authorization checks in the management API and preventing deactivated users from authenticating or maintaining sessions, improving the security posture of Kener’s admin/manage surface.

Changes:

  • Enforce AdminEditorCan role checks for updateMonitoringData (fixing member privilege escalation) and also for testTrigger / testMonitor.
  • Block sign-in for deactivated users (is_active = 0) with a clear 403 response.
  • Treat sessions for deactivated users as invalid by returning null from GetLoggedInSession.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/routes/(manage)/manage/api/+server.ts Adds missing AdminEditorCan checks to protect sensitive manage actions from lower-privilege roles.
src/routes/(account)/account/signin/+page.server.ts Prevents deactivated users from logging in.
src/lib/server/controllers/userController.ts Invalidates sessions for deactivated users during cookie/session validation.

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.

Member privilege escalation and deactivated user authentication bypass

2 participants