trails/apps/journal/app/routes
Ullrich Schäfer 1ae406a8aa
Implement OAuth2 PKCE auth, discovery, and mobile API client
Journal server (Phase 1.4 + 1.5):
- Add oauth_clients, oauth_codes, oauth_tokens tables to journal schema
- Implement GET /oauth/authorize with PKCE flow and login redirect
- Implement POST /oauth/token (authorization_code + refresh_token grants)
- Add validateBearerToken() + getAuthenticatedUser() middleware
- Seed trails-cool-mobile as trusted OAuth client on server startup
- Add GET /.well-known/trails-cool discovery endpoint
- Add returnTo support to login page and magic link verify
- Add @trails-cool/api workspace dependency to journal

Mobile app (Phase 1.5 + 1.6):
- Login screen with server URL input and discovery validation
- OAuth2 PKCE login via expo-web-browser with expo-crypto for Hermes
- Token storage in expo-secure-store with auto-refresh on 401
- API client with bearer token injection and typed errors
- Server URL persistence with localhost default in dev mode
- API version compatibility check on app foreground
- Log out + switch server on Profile tab
- iOS ATS exception for local networking

Tests:
- PKCE crypto verification, OAuthError, token generation
- Discovery endpoint response shape
- API version semver compatibility
- API client error types

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 00:41:40 +02:00
..
activities.$id.tsx Add ClientMap wrapper to avoid lazy() SSR resolution 2026-04-06 22:52:57 +02:00
activities._index.tsx Add ClientMap wrapper to avoid lazy() SSR resolution 2026-04-06 22:52:57 +02:00
activities.new.tsx Implement Journal activity feed (Group 10) 2026-03-24 23:20:04 +01:00
api.auth.login.ts Add transactional emails (SMTP) and planner features (no-go areas, notes, crash recovery) 2026-03-26 01:00:42 +01:00
api.auth.register.ts Passkey browser compatibility: detect support, magic link fallback 2026-03-29 09:54:37 +02:00
api.metrics.ts Add observability: health endpoints, structured logging, metrics, Grafana stack 2026-03-26 22:59:44 +01:00
api.routes.$id.callback.ts Fix CORS on Planner→Journal callback endpoint 2026-03-25 01:16:32 +00:00
api.routes.$id.edit-in-planner.ts Sync notes through GPX, Journal, and Planner roundtrip 2026-04-11 03:35:40 +02:00
api.routes.$id.gpx.ts Add route detail day segment highlighting and per-day GPX export 2026-04-11 00:44:11 +02:00
api.settings.delete-account.ts Add account settings page with passkey management 2026-03-29 10:09:06 +02:00
api.settings.email.ts Add account settings page with passkey management 2026-03-29 10:09:06 +02:00
api.settings.passkey.delete.ts Add account settings page with passkey management 2026-03-29 10:09:06 +02:00
api.settings.profile.ts Add account settings page with passkey management 2026-03-29 10:09:06 +02:00
api.sync.callback.$provider.ts Add Wahoo activity sync with provider-agnostic framework 2026-04-04 11:22:02 +01:00
api.sync.connect.$provider.ts Add Wahoo activity sync with provider-agnostic framework 2026-04-04 11:22:02 +01:00
api.sync.disconnect.$provider.ts Add Wahoo activity sync with provider-agnostic framework 2026-04-04 11:22:02 +01:00
api.sync.webhook.$provider.ts Fix Wahoo import crash for workouts without FIT files 2026-04-04 11:41:28 +01:00
api.well-known.trails-cool.test.ts Implement OAuth2 PKCE auth, discovery, and mobile API client 2026-04-13 00:41:40 +02:00
api.well-known.trails-cool.ts Implement OAuth2 PKCE auth, discovery, and mobile API client 2026-04-13 00:41:40 +02:00
auth.login.tsx Implement OAuth2 PKCE auth, discovery, and mobile API client 2026-04-13 00:41:40 +02:00
auth.logout.tsx Implement Journal auth: passkeys + magic links, no passwords 2026-03-23 17:38:46 +01:00
auth.register.tsx Passkey browser compatibility: detect support, magic link fallback 2026-03-29 09:54:37 +02:00
auth.verify.tsx Implement OAuth2 PKCE auth, discovery, and mobile API client 2026-04-13 00:41:40 +02:00
home.tsx Only show add-passkey prompt when user has no passkeys 2026-03-29 10:50:30 +02:00
oauth.authorize.tsx Implement OAuth2 PKCE auth, discovery, and mobile API client 2026-04-13 00:41:40 +02:00
oauth.token.ts Implement OAuth2 PKCE auth, discovery, and mobile API client 2026-04-13 00:41:40 +02:00
privacy.tsx Add transactional emails (SMTP) and planner features (no-go areas, notes, crash recovery) 2026-03-26 01:00:42 +01:00
routes.$id.edit.tsx Implement Journal route management (Group 8) 2026-03-23 22:25:10 +01:00
routes.$id.tsx Add route detail day segment highlighting and per-day GPX export 2026-04-11 00:44:11 +02:00
routes._index.tsx Add ClientMap wrapper to avoid lazy() SSR resolution 2026-04-06 22:52:57 +02:00
routes.new.tsx Implement Journal route management (Group 8) 2026-03-23 22:25:10 +01:00
settings.tsx Add Wahoo activity sync with provider-agnostic framework 2026-04-04 11:22:02 +01:00
sync.import.$provider.tsx Pass workout stats (distance, duration, startedAt) through on import 2026-04-05 19:59:54 +02:00
users.$username.tsx Implement Journal auth: passkeys + magic links, no passwords 2026-03-23 17:38:46 +01:00