feat(backend,waiter,terminal,manager): sign-in: ask before signing a waiter's other phone out, usernames on paired screens

- auth.single_session_waiter gains 'ask', the new default (Alembic 0051 moves venues on 'off'
  to it): a second phone gets auth.session_elsewhere {device, since}; Continue retries with
  replace=true and the first phone is signed out at once (live session.ended, reason
  "replaced") and says why on its sign-in page. Only phones count (terminal sessions are
  their own client). refuse_new / end_old unchanged.
- auth.session_ended now carries the reason; the waiter app keeps it until the next sign-in.
- The waiter app sends queued offline ops on every (re)connection, so an order queued on a
  phone that was signed out by another goes out after the next sign-in there (e2e checked).
- auth.terminal_require_username (venue) + Device.require_username (per device, wins):
  GET /api/devices/me/users lists nobody, the screen asks for a username then PIN/password,
  a picked user_id is refused (auth.username_required), "tap" falls back to PIN.
- Manager: Sign-in settings (ask, the new switch), the device dialog's usernames choice.

Plan platform-v2 6F.7.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-23 12:51:37 +02:00
co-authored by Claude Opus 5.5
parent 3eeafb565a
commit 7706bf2470
31 changed files with 494 additions and 41 deletions
+1
View File
@@ -29,6 +29,7 @@
"invalid_credentials": "Λάθος όνομα χρήστη ή κωδικός.",
"session_ended": "Η σύνδεσή σας έληξε. Συνδεθείτε ξανά.",
"session_exists": "Είστε ήδη συνδεδεμένοι σε άλλο {{client}}. Αποσυνδεθείτε πρώτα από εκεί.",
"session_elsewhere": "Είστε συνδεδεμένοι σε άλλη συσκευή ({{device}}, από {{since}}). Συνέχεια; Εκείνη θα αποσυνδεθεί.",
"login_mode_not_allowed": "Αυτός ο τρόπος σύνδεσης δεν είναι ενεργός ({{mode}}).",
"mode_needs_device": "Η σύνδεση με {{mode}} γίνεται μόνο σε συζευγμένη συσκευή.",
"username_required": "Συμπληρώστε το όνομα χρήστη.",
+13 -2
View File
@@ -222,7 +222,12 @@
"linkHint": "Για παράδειγμα μια οθόνη πελάτη που δείχνει την παραγγελία ενός ταμείου πάγκου.",
"full": "{{label}}: η άδεια επιτρέπει {{max}} και χρησιμοποιούνται όλα. Αφαιρέστε μία ή ζητήστε μεγαλύτερη άδεια.",
"noApps": "Καμία εφαρμογή συσκευών δεν είναι ενεργή. Ενεργοποιήστε μία πρώτα από τις Εφαρμογές.",
"signInTip": "PIN ή κωδικός: ο καθένας συνδέεται. Πάτημα στο όνομα: ο καθένας αλλάζει χρήστη χωρίς μυστικό (κοινό ταμείο). Κανένας: η οθόνη δουλεύει χωρίς χρήστη (οθόνη κουζίνας)."
"signInTip": "PIN ή κωδικός: ο καθένας συνδέεται. Πάτημα στο όνομα: ο καθένας αλλάζει χρήστη χωρίς μυστικό (κοινό ταμείο). Κανένας: η οθόνη δουλεύει χωρίς χρήστη (οθόνη κουζίνας).",
"usernames": "Το προσωπικό γράφει το όνομα χρήστη",
"usernamesDefault": "Όπως το κατάστημα ({{value}})",
"usernamesYes": "Ναι",
"usernamesNo": "Όχι, επιλέγουν το όνομά τους",
"usernamesTip": "Ναι: η οθόνη δεν δείχνει κανέναν και ζητά όνομα χρήστη, μετά PIN ή κωδικό. Η «Επιλογή ονόματος» δεν γίνεται μαζί του."
},
"actions": {
"rename": "Μετονομασία",
@@ -389,7 +394,8 @@
"session": {
"off": "Επιτρέπεται σε πολλές συσκευές",
"refuse_new": "Άρνηση δεύτερης σύνδεσης",
"end_old": "Αποσύνδεση της παλιότερης"
"end_old": "Αποσύνδεση της παλιότερης",
"ask": "Ερώτηση, μετά αποσύνδεση του άλλου κινητού"
},
"signIn": {
"title": "Σύνδεση",
@@ -404,8 +410,13 @@
"requireUsernameHint": "Αντί να επιλέγουν το όνομά τους από τη λίστα.",
"device": "Στις συζευγμένες συσκευές (οθόνη κουζίνας, ταμείο πάγκου) το προσωπικό συνδέεται με",
"deviceHint": "Κάθε συσκευή μπορεί να έχει δική της επιλογή στη σελίδα Συσκευές.",
"terminalUsername": "Στις συζευγμένες συσκευές το προσωπικό γράφει το όνομα χρήστη",
"terminalUsernameHint": "Η οθόνη δεν δείχνει ονόματα· η «Επιλογή ονόματος» ζητά τότε PIN. Κάθε συσκευή μπορεί να επιλέξει αλλιώς στη σελίδα Συσκευές.",
"terminalUsernameTip": "Όποιος στέκεται στο ταμείο δεν βλέπει ποιοι δουλεύουν εδώ ούτε δοκιμάζει το PIN συναδέλφου πατώντας ονόματα.",
"singleManager": "Μία σύνδεση ανά υπεύθυνο",
"singleWaiter": "Μία σύνδεση ανά σερβιτόρο",
"singleWaiterHint": "Μετράνε μόνο τα κινητά: η σύνδεση και στο ταμείο επιτρέπεται.",
"singleWaiterTip": "Ερώτηση: το κινητό λέει πού είναι ήδη συνδεδεμένος ο σερβιτόρος και από πότε. Η «Συνέχεια» αποσυνδέει αμέσως εκείνο το κινητό, που δείχνει γιατί. Παραγγελίες που είχε ακόμα να στείλει μένουν σε αυτό και φεύγουν την επόμενη φορά που θα συνδεθεί κάποιος εκεί.",
"singleTip": "Όταν κάποιος είναι ήδη συνδεδεμένος σε άλλη συσκευή: επιτρέπονται και οι δύο, απορρίπτεται η νέα σύνδεση ή αποσυνδέεται η παλιότερη.",
"idle": "Αποσύνδεση μετά από",
"idleHint": "Ημέρες χωρίς χρήση της εφαρμογής (διαχείριση, εφαρμογή σερβιτόρων και συζευγμένες συσκευές). Την επόμενη φορά συνδέονται ξανά.",
+4 -1
View File
@@ -14,7 +14,10 @@
"submit": "Σύνδεση",
"back": "Πίσω",
"empty": "Κανείς δεν μπορεί να συνδεθεί εδώ ακόμη",
"emptyBody": "Δώστε σε κάποιον το δικαίωμα {{app}} στο Προσωπικό, στη διαχείριση."
"emptyBody": "Δώστε σε κάποιον το δικαίωμα {{app}} στο Προσωπικό, στη διαχείριση.",
"username": "Όνομα χρήστη",
"next": "Επόμενο",
"typeUsername": "Γράψτε το όνομα χρήστη σας"
},
"blocked": {
"off": "Η εφαρμογή {{app}} είναι απενεργοποιημένη",
+7 -1
View File
@@ -84,7 +84,13 @@
"username": "Όνομα χρήστη",
"password": "Κωδικός",
"signIn": "Σύνδεση",
"enterPin": "Εισάγετε PIN"
"enterPin": "Εισάγετε PIN",
"elsewhereTitle": "Συνδεδεμένοι σε άλλη συσκευή",
"elsewhereBody": "Είστε συνδεδεμένοι σε άλλη συσκευή ({{device}}) από τις {{time}}. Συνέχεια; Εκείνη θα αποσυνδεθεί.",
"elsewhereContinue": "Συνέχεια",
"elsewhereCancel": "Άκυρο",
"signedOutReplaced": "Αποσυνδεθήκατε: συνδεθήκατε σε άλλη συσκευή.",
"signedOut": "Αποσυνδεθήκατε. Συνδεθείτε ξανά."
},
"card": {
"freeLower": "Ελεύθερο",
+1
View File
@@ -29,6 +29,7 @@
"invalid_credentials": "Wrong username or password.",
"session_ended": "Your session has ended. Please log in again.",
"session_exists": "You're already logged in on another {{client}}. Log out there first.",
"session_elsewhere": "You're signed in on another device ({{device}}, since {{since}}). Continue? It will be signed out.",
"login_mode_not_allowed": "This way of logging in isn't enabled ({{mode}}).",
"mode_needs_device": "Logging in by {{mode}} only works on a paired device.",
"username_required": "Enter your username.",
+13 -2
View File
@@ -222,7 +222,12 @@
"linkHint": "For example a customer display that shows a counter POS's order.",
"full": "{{label}}: the license allows {{max}}, all in use. Remove one or ask for a bigger license.",
"noApps": "No device app is turned on. Turn one on in Apps first.",
"signInTip": "PIN or password: each person signs in. Tap your name: anyone switches user without a secret (a shared counter). None: the screen works without a user (a kitchen display)."
"signInTip": "PIN or password: each person signs in. Tap your name: anyone switches user without a secret (a shared counter). None: the screen works without a user (a kitchen display).",
"usernames": "Staff type their username",
"usernamesDefault": "Venue default ({{value}})",
"usernamesYes": "Yes",
"usernamesNo": "No, they pick their name",
"usernamesTip": "Yes: the screen lists nobody and asks for a username, then the PIN or password. \"Tap your name\" can't be used with it."
},
"actions": {
"rename": "Rename",
@@ -389,7 +394,8 @@
"session": {
"off": "Allowed on several devices",
"refuse_new": "Refuse a second sign-in",
"end_old": "Sign out the older one"
"end_old": "Sign out the older one",
"ask": "Ask, then sign out the other phone"
},
"signIn": {
"title": "Sign-in",
@@ -404,8 +410,13 @@
"requireUsernameHint": "Instead of picking their name from the list.",
"device": "On paired devices (kitchen display, counter POS), staff sign in with",
"deviceHint": "Each device can choose its own on the Devices page.",
"terminalUsername": "On paired devices, staff type their username",
"terminalUsernameHint": "No names are listed on the screen; \"Tap your name\" asks for the PIN instead. Each device can choose otherwise on the Devices page.",
"terminalUsernameTip": "Someone standing at the counter can't see who works here or try a colleague's PIN by tapping names.",
"singleManager": "One session per manager",
"singleWaiter": "One session per waiter",
"singleWaiterHint": "Only phones count: signing in at the counter as well is fine.",
"singleWaiterTip": "Ask: the phone says where the waiter is already signed in and since when. Continue signs that phone out at once, and it shows why. Orders it still had to send stay on it and go out the next time someone signs in there.",
"singleTip": "When someone is already signed in on another device: allow both, refuse the new sign-in, or sign out the older one.",
"idle": "Sign people out after",
"idleHint": "Days without using the app (manager, waiter app and paired devices). They sign in again next time.",
+4 -1
View File
@@ -14,7 +14,10 @@
"submit": "Sign in",
"back": "Back",
"empty": "Nobody can sign in here yet",
"emptyBody": "Give someone the {{app}} permission under Staff in the manager."
"emptyBody": "Give someone the {{app}} permission under Staff in the manager.",
"username": "Username",
"next": "Next",
"typeUsername": "Type your username"
},
"blocked": {
"off": "{{app}} is turned off",
+7 -1
View File
@@ -84,7 +84,13 @@
"username": "Username",
"password": "Password",
"signIn": "Sign in",
"enterPin": "Enter your PIN"
"enterPin": "Enter your PIN",
"elsewhereTitle": "Signed in on another device",
"elsewhereBody": "You're signed in on another device ({{device}}) since {{time}}. Continue? It will be signed out.",
"elsewhereContinue": "Continue",
"elsewhereCancel": "Cancel",
"signedOutReplaced": "Signed out: you signed in on another device.",
"signedOut": "You were signed out. Sign in again."
},
"card": {
"freeLower": "Free",