LifeMate — Personal, Family & Learning Companion
feat/flutter-mobile-navigation
chore/phase1-repository-cleanup
deploy/stable-web-apk
deployment-static
design/mobile-accessibility-v2
design/mobile-navigation-review
docs/child-education-access-decision
docs/offline-data-rescue-options
docs/owner-guide-and-delivery-plan
docs/phase1-policy-options
docs/public-review-live-2026-10-15
feat/aparat-learning-library
feat/child-device-safety
feat/child-identity-schema
feat/flutter-mobile-navigation
feat/learning-content-operations
feat/local-signing-preflight
feat/online-family-stage0
feat/personal-encrypted-recovery
feat/private-planner-series-api
feat/public-review-page
feat/standalone-weekly-planner
feat/weekly-planner-android
final-feature-1/iran-family-school
fix/auth-abuse-expiry-safety
fix/auth-expiry-after-lock
fix/backend-request-safety
fix/lifeguide-bootstrap-naming-ci
fix/lifeguide-pages-qa-base-preflight
fix/lifeguide-qa-pages-env-deployment
fix/local-task-persistence
fix/managed-child-session-boundary
fix/personal-jalali-dates
fix/personal-notification-controls
fix/personal-upgrade-delivery-guard
fix/sms-approval-gates
fix/study-duration-display
infra/cloudflare-neon-migration
infra/lifeguide-cloudflare-qa
infra/lifeguide-github-pages-qa
infra/lifeguide-supabase-qa
main
phase-1/foundation-completion
phase-2/product-foundation-identity
phase-3/planner-school-family-core
phase-4/ai-learning-wellbeing
phase-5/hardening-observability-release
test/android-reminder-acceptance
test/personal-notification-settings
test/personal-recovery-acceptance
test/role-entry-apk
| 1 | import 'dart:js_interop'; |
| 2 | import 'session_store.dart'; |
| 3 | import 'web_instance.dart'; |
| 4 | |
| 5 | @JS('localStorage') |
| 6 | external _Storage get _storage; |
| 7 | extension type _Storage(JSObject _) implements JSObject { |
| 8 | external String? getItem(String key); |
| 9 | external void setItem(String key, String value); |
| 10 | external void removeItem(String key); |
| 11 | } |
| 12 | |
| 13 | /// One opaque refresh token, bound to its configured HTTPS endpoint. Access |
| 14 | /// tokens stay in memory. This requires the host's HTTPS and strict CSP gates. |
| 15 | class PlatformSessionStore implements SessionStore { |
| 16 | @override |
| 17 | Future<String?> read() async { |
| 18 | requireWebInstanceOwnership(); |
| 19 | return _storage.getItem(sessionStorageKey); |
| 20 | } |
| 21 | |
| 22 | @override |
| 23 | Future<void> write(String value) async { |
| 24 | requireWebInstanceOwnership(); |
| 25 | _storage.setItem(sessionStorageKey, value); |
| 26 | } |
| 27 | |
| 28 | @override |
| 29 | Future<void> clear() async { |
| 30 | requireWebInstanceOwnership(); |
| 31 | _storage.removeItem(sessionStorageKey); |
| 32 | } |
| 33 | } |