Feature #9110
closedwork on guest login and integrate across the mythri website
Added by Subhani Shaik about 10 hours ago. Updated about 10 hours ago.
Subtasks
Related issues
Updated by Subhani Shaik about 10 hours ago
- Status changed from New to Closed
- % Done changed from 0 to 100
- Estimated time set to 8:00 h
Updated by Subhani Shaik about 10 hours ago
- Complete Work Description (Mythri Restaurant Customer-Facing Updates)
- 1. Security & Validations Hardening
Unified strict input validations and password policies across all authentication points (Login, Register, Guest Modal, Reset Password).
- Password Policy Overhaul
- Strict Complexity: Enforced a new, highly secure password policy requiring a minimum of 6 characters and a maximum of 20 characters.
- Character Requirements: Passwords must contain at least one uppercase letter, one lowercase letter, and one special character.
- Scope: Applied globally to both `RegisterPage.tsx` and `ResetPasswordPage.tsx`.
- Unified Form Validations (Login, Register, Guest)
- Name Fields (First/Last):
- Constraint: Hard limit of 25 characters maximum.
- Sanitization: Implemented live-typing interceptors that actively strip out numbers and all special characters, ensuring only letters and spaces are recorded.
- Phone Fields:
- Constraint: Enforced a strict 10-digit raw limit.
- Sanitization: Blocks all letters and special characters natively. Inputs automatically format to the standard US layout `(XXX) XXX-XXXX`. Submissions are strictly blocked if exactly 10 raw digits aren't present.
- Email Fields:
- Constraint: Replaced the legacy loose regex with a strict global standard (`/^[a-zA-Z0-9._\-+]+[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}$/`).` symbol, strictly allowing only `.` `_` `-` `+`.
- *Sanitization:* Rejects all special characters (e.g., `!`, `#`, `$`, `%`) before the `
- 2. UX Overhaul: Table Booking Flow
Redesigned the table booking system to remove friction and behave with the same seamless experience as the Menu.
- Frictionless UI Redesign
- Simplified Interface: Completely stripped out the clunky personal detail inputs (Name, Phone, Email) from the primary `BookPage.tsx` screen to drastically lower cognitive load. Users now solely select their Date, Guests, and Time.
- Smart Auth Modal Integration: When a user clicks "Confirm Booking", they are no longer redirected to a different page. Instead, the centralized `AuthModal` instantly slides up.
- Intelligent Booking Execution
- Guest Intercept: If the user selects "Continue as Guest", they fill out their details in the modal, and the table is booked instantly without ever leaving the page.
- Magic Auto-Submit: If the user chooses to "Login" or "Register", their selected table slot is cached in the browser's `sessionStorage`. Once authentication is complete, they are seamlessly redirected back and the system automatically completes the booking in the background without requiring a second click.
- 3. Cart & Checkout Unification
Synchronized the guest checkout and table booking states to eliminate redundant data entry.
- Centralized `AuthModal`: Refactored the `AuthModal.tsx` to handle authentication from anywhere in the application dynamically via the `onGuestSubmit` callback.
- Cross-Pollination of Data: Wired the system so that if a user books a table as a guest, their contact information is securely cached in `sessionStorage`. If they subsequently navigate to their Cart to order food, the Checkout page is magically pre-filled with the exact details they used for their table reservation.
- 4. Core Bug Fixes & System Cleanup
- Infinite Reload Loop Fix: Patched a critical bug in the core API interceptor (`axios.ts`) that was causing the frontend to fall into an infinite reload loop when handling `401 Unauthorized` errors during token expiration.
- Filesystem Cleanup: Identified and deleted stubborn background testing files (`test_hours.json`, `test_slots.js`) that were locking up the Git branch and causing "Device or resource busy" system errors.
Status: All tasks have been successfully implemented, compiled, and actively running on the local environment without errors.