From b64a4029e763bfc98aaeabfbebc8b6648270831a Mon Sep 17 00:00:00 2001 From: Sylvain Bettinelli Date: Tue, 5 May 2026 19:24:14 +0000 Subject: [PATCH] =?UTF-8?q?Revert=20auto-login=20via=20/login=3Ftoken=3D..?= =?UTF-8?q?.=20=E2=80=94=20WKWebView=20casse=20le=20redirect=20303?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit WebKit error code 102 (Frame load interrupted by policy change) sur le redirect 303 retourné par /login après pose du cookie. Solution Phase 0 : laisser le user saisir le token une fois via le formulaire /login standard, le cookie coach_web_token (1 an, secure, httponly, samesite=lax) doit persister dans WKWebView pour les lancements suivants. Si la persistance cookie échoue : inject natif via AppDelegate.swift à venir. --- capacitor.config.ts | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/capacitor.config.ts b/capacitor.config.ts index 4b99874..58e2696 100644 --- a/capacitor.config.ts +++ b/capacitor.config.ts @@ -1,19 +1,4 @@ import type { CapacitorConfig } from '@capacitor/cli'; -import { readFileSync, existsSync } from 'fs'; -import { resolve } from 'path'; - -// Token d'auth coach.hypnotruck.ch chargé depuis coach-ios.local.json (gitignored). -// Sur le Mac mini : créer ce fichier avec { "coachWebToken": "..." } avant de builder. -const localConfigPath = resolve(__dirname, 'coach-ios.local.json'); -const localConfig = existsSync(localConfigPath) - ? JSON.parse(readFileSync(localConfigPath, 'utf-8')) - : {}; -const coachWebToken: string = localConfig.coachWebToken || ''; - -const baseUrl = 'https://coach.hypnotruck.ch'; -const startUrl = coachWebToken - ? `${baseUrl}/login?token=${encodeURIComponent(coachWebToken)}` - : baseUrl; const config: CapacitorConfig = { appId: 'ch.hypnotruck.coach', @@ -21,7 +6,7 @@ const config: CapacitorConfig = { webDir: 'www', server: { - url: startUrl, + url: 'https://coach.hypnotruck.ch', cleartext: false, androidScheme: 'https', },