Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.
| The phone app's scaffolding, in apps/mobile: Expo SDK 57 with Expo Router, Android first, with Chat, Code and Customize. It signs in with g1t's own OAuth 2.1 (PKCE, a client id that encodes "g1t for Android" and g1t://oauth/callback, so nothing is registered), keeps the server and credentials in the phone's keystore, refreshes the 30-day token a minute early and shares the single-use refresh between requests. A personal access token is the other way in, and a self-hosted g1t the other server. | 1 | import { Redirect } from "expo-router"; |
| 2 | ||
| 3 | import { Loading, Screen } from "@/components/ui"; | |
| 4 | import { useSession } from "@/lib/session"; | |
| 5 | ||
| 6 | /** | |
| 7 | * Where the site sends the person back after they approve the app | |
| 8 | * (`g1t://oauth/callback`). The sign-in screen's browser session reads | |
| 9 | * the code from the address itself (lib/oauth.ts); this screen is only | |
| 10 | * what shows if the link opens the app on its own, and it moves on. | |
| 11 | */ | |
| 12 | export default function OAuthCallback() { | |
| 13 | const { state } = useSession(); | |
| 14 | if (state.status === "loading") { | |
| 15 | return ( | |
| 16 | <Screen> | |
| 17 | <Loading /> | |
| 18 | </Screen> | |
| 19 | ); | |
| 20 | } | |
| 21 | return <Redirect href={state.status === "signed-in" ? "/chat" : "/sign-in"} />; | |
| 22 | } |