Skip to content

[Frontend] Implement Mock Authentication Flow for Expo Go Compatibility #92

@MohamadNazik

Description

@MohamadNazik

Description:
The mobile application currently relies on react-native-app-auth, a native module not supported by Expo Go. This prevents UI development and testing on physical devices without full native builds.

Proposed Solution:
Implement a mock authentication toggle (EXPO_PUBLIC_MOCK_AUTH=true) to bypass native module calls.

Acceptance Criteria:

  • The app can be launched on a physical device using the Expo Go app without crashing.
  • When EXPO_PUBLIC_MOCK_AUTH=true, clicking the "Sign In" button skips the authorize() call and immediately updates the app state to isAuthenticated: true.
  • A hardcoded mock user profile and token are provided to the rest of the application.
  • Authenticated API calls to the local backend use the mock token instead of failing.
  • Native-only features (Notifications, Google Sign-In) are gracefully caught to prevent "null reference" errors in Expo Go.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions