Revert auto-login via /login?token=... — WKWebView casse le redirect 303
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.
This commit is contained in:
@@ -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',
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user