changed fcntl to portalocker to ensure compatiblity with windows#45
Merged
muellerberndt merged 3 commits intoOct 15, 2025
Merged
Conversation
|
|
Collaborator
|
Thanks! I believe we need to update requirements.txt also? |
Collaborator
|
Please also run |
Author
thanks for pointing that out. have made the necessary changes now :) |
zcor
added a commit
to zcor/hound
that referenced
this pull request
Jun 1, 2026
… tokens (scabench-org#45) Admin preview tokens carry user_id=0 and admin_preview=True. The previous check in get_current_user() treated user_id=0 as "invalid token" and raised 401. The frontend api-client treats every 401 as session-expired and dispatches auth:session-expired, which restores the stashed real session and redirects to "/". Admins who clicked into any page that calls getCurrentUser() (audit detail hits /users/me via apiClient.getCurrentUser to prefill a contact-email prompt) got silently booted out of preview. Return 404 instead of 401 when user_id is falsy AND admin_preview is set. Semantically correct — we are previewing a tenant, there is no "me" user to return — and does NOT trip the 401 session-expired flow. Repros: open admin panel, click "Preview Dashboard" on tenant 57, land on /; click into /audits/repo-27 — red ADMIN PREVIEW banner disappears and you're back to your own account. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
zcor
added a commit
to zcor/hound
that referenced
this pull request
Jun 1, 2026
scabench-org#46) My previous fix (scabench-org#45) added a check for payload.get("admin_preview") but get_current_user_from_token() strips the JWT payload down to {user_id, tenant_id} and discards custom claims — so the check always saw None and we still 401'd. Switch to decode_access_token() which returns the full payload. This is the same approach used by reject_preview_writes() in auth_utils.py (and CLAUDE.md gotcha #admin-preview documents the trap). Verified with a fresh preview JWT after deploy: /users/me returns 404 (was 401), preview banner persists across /audits/repo-27 navigation. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
resolve for #44