ensure inactive users cannot log in and restrict actions for non-admi…#601
Merged
rajnandan1 merged 1 commit intomainfrom Feb 24, 2026
Merged
ensure inactive users cannot log in and restrict actions for non-admi…#601rajnandan1 merged 1 commit intomainfrom
rajnandan1 merged 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
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
AdminEditorCanrole checks forupdateMonitoringData(fixing member privilege escalation) and also fortestTrigger/testMonitor. - Block sign-in for deactivated users (
is_active = 0) with a clear 403 response. - Treat sessions for deactivated users as invalid by returning
nullfromGetLoggedInSession.
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…n roles. Fixes #600