LoginScreen handles the full Roku on-device login flow. It meets Roku certification requirements by using a StandardKeyboardDialog for text entry and by requesting the user’s Roku account email through the ChannelStore getUserData command before submitting credentials.
Layout
The screen uses a two-panel layout:- Left panel — branding area with the GlobalTV logo and tagline
- Right panel — login form with username field, password field, show/hide toggle, and submit button
Focus model
Four focusable items are tracked by index:Keyboard entry
Tapping OK on a field opens aStandardKeyboardDialog. Password fields enable secureMode:
Roku email request (getUserData)
Before submitting credentials, the screen requests the user’s Roku account email using theChannelStore getUserData command. This is part of the Roku on-device login certification requirement.
m.global.rokuEmail and passed along with the credentials in the login result. If the request fails or returns empty, login continues without an email — this is a graceful fallback, not a hard error.
Authentication flow
User presses the Login button
TryLogin() is called. It first checks network connectivity via GTV_IsOnline().Roku email is requested
If
m.rfiResolved is not yet true, RequestRokuEmail() is called. Input is blocked until the response arrives.Credentials are validated locally
Username and password are trimmed with
GTV_SafeTrimLogin(). Empty values display an inline error and re-open the relevant keyboard.AuthTask is started
An
AuthTask node is created and given the username and password. Status messages from statusTick are shown in the status hint bar at the bottom.Auth guard timeout
A watchdog timer prevents the login from hanging indefinitely. Its duration is calculated fromAppConstants timeouts:
m.isSubmitting = true, the attempt is cancelled with the message “El servidor tardo demasiado en responder.”
Auto-login path
WhenMainScene detects saved credentials in the registry at startup, it bypasses LoginScreen entirely and runs AuthTask directly. LoginScreen is only shown if:
- There are no saved credentials (first run)
- Auto-login fails and
MainSceneredirects back to login - The user explicitly logs out from
SettingsScreen
Error handling
AUTH_REASON_CREDENTIALS (401)
AUTH_REASON_CREDENTIALS (401)
Password field is cleared and focus moves to the password input. A retry is expected.
AUTH_REASON_PASSWORD_CHANGED (471)
AUTH_REASON_PASSWORD_CHANGED (471)
Same as credentials failure — password cleared and refocused.
AUTH_REASON_INACTIVE (470)
AUTH_REASON_INACTIVE (470)
User account is inactive. Error is displayed at the button row. Password is cleared.
No network
No network
GTV_IsOnline() returns false. Error shown immediately without starting AuthTask.Interface fields
loginResult contains { username, password, rokuEmail } and is read by MainScene to start the playlist load.