You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: JWT field name mismatch in register + stuck 'Adding...' button in TableCheckoutModal #31
Bug 1: JWT field name mismatch breaks registration flow
Location:frontend/src/store/auth.ts:47-55
The backend POST /auth/register returns access_token, but the frontend register function reads data.token (which is undefined).
Backend (main/routes/auth.ts:455-456):
res.json({access_token: token, ... });
Frontend (frontend/src/store/auth.ts:47-55):
register: async(registerData: RegisterData)=>{const{ data }=awaitapi.post('/auth/register',registerData);localStorage.setItem('token',data.token);// ❌ should be data.access_tokenset({user: data.user,token: data.token,// ❌ undefinedtenants: [data.tenant],});},
Impact: After registration, the token stored is undefined. Subsequent API calls fail with 401. User appears logged in but sessions are broken until re-login.
Fix: Change data.token to data.access_token (matching the login function on line 39 and the backend response).
Bug 2: setAddingItems(true) never reset in TableCheckoutModal
consthandleAddCartToOrder=async()=>{if(!order||!onAddCartToOrder)return;setAddingItems(true);// ← set to trueonAddCartToOrder(table,order);// ← never reset};
Compare with handleCheckout which has proper try/finally:
Impact: Button can get stuck in "Adding..." state if the callback throws or the modal stays open. Low severity but inconsistent with the rest of the component.
Fix: Add try/finally around the callback, or accept that the parent handles state and reset in a finally block.
Activity
Bug of issue #64 solved-added a final else block to prevent any bad d…
fix(deps): bump nanoid to 3.3.18 to fix DoS in customAlphabet/customR…