Skip to content

Show deactivated account modal on POS login#828

Open
JustSamuel wants to merge 1 commit into
developfrom
feat/issue-813-deactivated-user-popup
Open

Show deactivated account modal on POS login#828
JustSamuel wants to merge 1 commit into
developfrom
feat/issue-813-deactivated-user-popup

Conversation

@JustSamuel
Copy link
Copy Markdown
Contributor

@JustSamuel JustSamuel commented May 7, 2026

Description

A user with active=false can 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

  • New DeactivatedAccountModalComponent.vue, modeled on TopUpWarningComponent (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.ts checks user.active after a successful login. If false, it sets showDeactivatedModal=true and skips the /cashier navigation. Adds dismissDeactivatedModal() which logs out and resets the keypad.
  • LoginView.vue mounts 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

Account deactivated modal on the POS login screen

Related issues/external references

Closes #813

Types of changes

  • New feature (non-breaking change which adds functionality)

@JustSamuel JustSamuel requested a review from Copilot May 7, 2026 17:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.vue to display a non-dismissible warning modal with an “I Understand” action.
  • Update useLoginForm.ts to show the modal when user.active === false and add dismissDeactivatedModal() 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.

Comment thread apps/point-of-sale/src/views/LoginView.vue Outdated
Comment thread apps/point-of-sale/src/components/DeactivatedAccountModalComponent.vue Outdated
@JustSamuel JustSamuel force-pushed the feat/issue-813-deactivated-user-popup branch 3 times, most recently from 1fa8e22 to 002df48 Compare May 7, 2026 19:12
@JustSamuel JustSamuel requested a review from Copilot May 24, 2026 08:24
@JustSamuel JustSamuel force-pushed the feat/issue-813-deactivated-user-popup branch from 002df48 to f1ec2c8 Compare May 24, 2026 08:24
@JustSamuel JustSamuel requested a review from SuperVK May 24, 2026 08:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread apps/point-of-sale/src/composables/useLoginForm.ts
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
@JustSamuel JustSamuel force-pushed the feat/issue-813-deactivated-user-popup branch from f1ec2c8 to 776389c Compare June 1, 2026 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🎨 Design: Show message for deactivated users

2 participants