Skip to content

M7.2.6: migrate app/login.tsx to use useAuth() from wp-native-shell #34

Description

@chubes4

Scope

Refactor app/login.tsx so it consumes useAuth() from wp-native-shell instead of EC's custom auth context.

Why

Once <WPNativeApp/> is the root layout (M7.2.5), the auth context comes from wp-native-shell. Every screen that calls useAuth() needs to import from wp-native-shell instead of ../src/auth/context.

Files affected

app/login.tsx

The change is mostly:

// Before:
import { useAuth } from '../src/auth/context';

// After:
import { useAuth } from 'wp-native-shell';

The hook contract is identical (per SHELL.md M5.1) — same login(), logout(), user, isAuthenticated, etc. Just the import path changes.

Things to verify

  • loginWithGoogle() either still works (if M7.2.3 kept the OAuth bits in a sibling hook) OR is documented as deferred per wp-native#18
  • Error states + session-expired handling still surface correctly
  • The login screen UI itself doesn't change visually

Sequencing

After M7.2.5. Potentially landed in the same PR as M7.2.5 if the diff is small.

Acceptance

  • All useAuth imports in app/login.tsx come from wp-native-shell
  • Login flow works end-to-end manually
  • npx tsc --noEmit passes

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    wp-native-extractionCoupling to extract for wp-native framework

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions