Show deactivated account modal on POS login#828
Open
JustSamuel wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a “deactivated account” guard to the POS login flow so deactivated users immediately see an explanatory modal and are prevented from entering the cashier flow.
Changes:
- Add
DeactivatedAccountModalComponent.vueto display a non-dismissible warning modal with an “I Understand” action. - Update
useLoginForm.tsto show the modal whenuser.active === falseand adddismissDeactivatedModal()to log out and reset the keypad state. - Mount and wire the modal into
LoginView.vue.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| apps/point-of-sale/src/views/LoginView.vue | Mounts the new modal and connects it to login state + dismiss handler. |
| apps/point-of-sale/src/composables/useLoginForm.ts | Introduces deactivated-user gating and a dismiss flow that logs out and resets the form. |
| apps/point-of-sale/src/components/DeactivatedAccountModalComponent.vue | Implements the deactivated account modal UI and emits dismiss / v-model updates. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1fa8e22 to
002df48
Compare
002df48 to
f1ec2c8
Compare
When a deactivated user (active=false) successfully authenticates at the POS keypad, show a modal explaining their account is deactivated and that they cannot make purchases. Clicking "I Understand" logs them out and clears the keypad, preventing entry into the cashier flow. Refs #813
f1ec2c8 to
776389c
Compare
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.
Description
A user with
active=falsecan authenticate on the POS but can't buy anything once they're in. They get parked on the cashier screen with nothing telling them why nothing works.This PR pops a modal right after auth if
user.active === false. The modal says the account is deactivated and to contact the SudoSOS administrators. "I Understand" logs them out and sends them back to the keypad, so they don't enter the cashier flow at all.What changed
DeactivatedAccountModalComponent.vue, modeled onTopUpWarningComponent(closable=false, dismissable-mask=false, close-on-escape=false, same "I Understand" button styling). One-way:show+@dismiss; you can only get out by clicking the button.useLoginForm.tschecksuser.activeafter a successful login. If false, it setsshowDeactivatedModal=trueand skips the/cashiernavigation. AddsdismissDeactivatedModal()which logs out and resets the keypad.LoginView.vuemounts the modal and wires the dismiss handler.The login call still completes (so a JWT briefly exists), but the logout fires on dismiss before any navigation off
/login.Screenshot
Related issues/external references
Closes #813
Types of changes