Login Screen
The Login screen is the first access point for Emblem Tameiaki. It collects the user's email and password, authenticates the account, loads company context, and moves the user into the Dashboard after a successful login.
Who Uses It
- Store staff signing in at the start of a shift
- Account administrators accessing the app after logout or session reset
- Support teams helping a customer recover access
What Users See
The screen presents the Emblem Tameiaki logo, a welcome message, and a centered login form.
- A language selector appears in the top-right safe area.
- The email field uses a person icon and accepts the user's email address.
- The password field uses a lock icon and hides the password by default.
- The eye icon toggles password visibility.
- The Forgot Password link opens a reset-password modal.
- The Login button is disabled until both email and password have values.
- While login or password reset work is in progress, the screen shows a loading indicator instead of allowing duplicate actions.
Login Flow
When the user taps Login:
- The app starts the loading state.
- The login use case clears locally cached general materials and material categories so the next account starts with fresh local data.
- The app sends the email and password to the authentication API.
- If authentication succeeds, the app stores the user ID, token, and password in local storage.
- The app stores the last logged-in user ID so account changes can be detected later.
- The app updates the global app store with the token and password.
- The app loads company information for the authenticated account.
- Navigation resets to the Dashboard.
Failure Behavior
If authentication fails, the user stays on the Login screen and sees an error popup with this message:
Invalid email or password
The popup title uses the localized common error label. Closing the popup clears the screen error state.
Forgot Password Flow
The Forgot Password link opens a modal that asks for the user's email address.
- Empty email submissions are ignored.
- The modal checks whether the email belongs to a main user.
- The app sends the reset-password request with the correct main-user flag.
- Success messages are shown in the modal as success text.
- Failed reset requests show an error message in the modal.
- The modal clears its email input after a message appears.
The English modal copy tells the user that the Emblem team will send a reset link after they enter their email address.
Support Notes
- If the Login button is gray or disabled, confirm that both email and password fields are filled.
- If a user cannot see what they typed in the password field, ask them to use the eye icon to temporarily reveal it.
- If the app reports invalid credentials, ask the user to confirm the email address and try the Forgot Password flow.
- If login succeeds but data looks like another account, ask the user to log out and sign in again; the login flow refreshes local material caches during authentication.
- The visible Debug input modal entry is a development/testing control and should not be part of normal customer guidance.
Expected Result
A successful login lands the user on the Dashboard with account token, password, company information, and last-user tracking saved for the active session.