Repository navigation
feat(server-app): allow management roles in standalone login - #481
Merged
Merged
Conversation
Widen SERVER_APP_ALLOWED_ROLES to server, manager, and owner, mirroring KDS's front-line + management login pattern. Reword both 403 messages to name the accepted roles. Add a localized serverApp.loginHint under the standalone login form in all four locales. Update the role test to expect 200 (with /api/auth/me verification) for owner/manager while cashier and chef remain 403. Refs #438
Contributor
Greptile SummaryThe PR aligns standalone Server App access with the KDS role pattern by admitting server, manager, and owner accounts.
Confidence Score: 5/5The PR appears safe to merge, with the expanded roles consistently supported by the standalone UI, proxy routes, and downstream authorization. Manager and owner sessions follow the same authenticated path as server sessions, and every operation exposed through the standalone proxy already authorizes both management roles.
|
| Filename | Overview |
|---|---|
| main/server-app.ts | Consistently expands both login and token-validation gates to server, manager, and owner; all proxied downstream routes support the added roles. |
| frontend/src/app/server-standalone/page.tsx | Renders the new localized eligibility hint beneath the login form without changing authentication behavior. |
| tests/server-app-server-role.test.ts | Covers successful login and /api/auth/me access for all three admitted roles while retaining rejection checks for cashier and chef. |
| frontend/src/lib/i18n/messages/en.json | Adds the English Server App login hint with role eligibility matching the backend allowlist. |
| frontend/src/lib/i18n/messages/es.json | Adds the corresponding Spanish login hint. |
| frontend/src/lib/i18n/messages/fa.json | Adds the corresponding Farsi login hint. |
| frontend/src/lib/i18n/messages/pt.json | Adds the corresponding Portuguese login hint. |
Reviews (1): Last reviewed commit: "feat(server-app): allow manager and owne..." | Re-trigger Greptile
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.
Intent
Implement the reviewed plan from the flocafe-serverapp-roles scout report: allow owner and manager to log in to the standalone Server App alongside server, mirroring KDS's front-line+management pattern.
Requirements:
Verified context: no privilege escalation - every proxied endpoint already authorizes manager/owner on the main API; chef is excluded because order creation would 403 at the main API (broken half-working login).
PR body must include: 'Fixes #472-review follow-up; implements captain-requested Server App role alignment' plus 'Refs #438'. Use a descriptive conventional-commit title.
What Changed
server,manager, andowneraccounts, updated both 403 messages, and covered allowed/denied login plus/api/auth/mebehavior.serverApp.loginHintwith translations in English, Spanish, Portuguese, and Farsi to clarify eligible tableside-ordering accounts.Risk Assessment
✅ Low: The bounded role, proxy, localization, and integration-test changes satisfy the stated source requirements; manager and owner requests remain constrained by the main API’s existing role checks.
Testing
Fresh targeted integration, translation, and i18n checks passed. Live API behavior and rendered login/post-login surfaces were verified; generated dependencies, builds, and temporary database data were removed afterward.
Evidence: Server App role API transcript
/Users/gurkiratkhaira/.no-mistakes/evidence/01M0QNYFJ22MWK159HJK7HRADG/server-app-login-en.png)/Users/gurkiratkhaira/.no-mistakes/evidence/01M0QNYFJ22MWK159HJK7HRADG/server-app-manager-session.png)Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
npm run test:server-app-server-rolenpm run test:translationsnpm run i18n:checkLive API checks for owner, manager, server, cashier, and chef login plus/api/auth/meBrowser login using manager credentials on/server-standalone/Screenshots captured to the evidence directorygit diff --check✅ **Document** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.