Fix admin redirects and add consent-based visitor alerts - #11
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Dev-Sahad
marked this pull request as draft
July 20, 2026 11:33
Dev-Sahad
marked this pull request as ready for review
July 20, 2026 11:33
| const alreadyNotified = sessionStorage.getItem('_visited') | ||
| if (!alreadyNotified) { | ||
| const visitorContext = () => ({ | ||
| sessionId: sid, |
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.
What changed
Why
The login component could retain a server-created null client and depended on a delayed client-side route change, leaving successful logins on the login page. Visitor notifications could only show anonymous or IP-estimated data, and the live viewer endpoint exposed session summaries without an admin check.
Impact
Admin sign-in now performs a reliable dashboard navigation and existing admins are redirected automatically. Visitors can voluntarily share their name, optional phone, and browser-approved precise location; they can also skip the prompt. Precise location is never requested or sent without consent.
Validation
npx tsc --noEmitnpm run build/admin/dashboard:307to/admin/login/admin/login:200GET /api/visitors:401200Required configuration
ADMIN_EMAILand optionallyADMIN_USER_IDin VercelDISCORD_WEBHOOK_URLor save a webhook URL in the admin webhook settings