Installer sur iPhone et connexion avec Apple
deploy / deploy (push) Successful in 1m4s

- Guide « Installer Bobinoo » pour iPhone et iPad (menu Partager →
  « Sur l'écran d'accueil ») : carte masquable sur l'accueil et section
  dans les Réglages, seulement dans le navigateur d'un appareil Apple.
- « Continuer avec Apple » sur l'écran de connexion : même parcours
  sécurisé que Google (OAuth + PKCE). Le bouton n'apparaît qu'une fois
  Apple activé dans Supabase (procédure : docs/connexion-apple.md).
- Textes dans les 18 langues ; politique de confidentialité à jour.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YVo1qxKoBQCaMd7Ue8PGbe
This commit is contained in:
Claude committed 2026-12-02 09:40:48 +00:00
1 parent 6e609d499d
commit 673214304b
28 files changed
+350 -24

No files matched your search

+32 -6
View File
@@ -3,7 +3,7 @@ import { LanguageSelect } from '../i18n/react'
import { Eye, EyeOff, Loader2 } from 'lucide-react'
import { useEffect, useState, type FormEvent, type ReactNode } from 'react'
import { useBackToClose } from '../lib/backNav'
import { PASSWORD_MIN, requestPasswordReset, signIn, signInWithGoogle, signOut, signUp, updatePassword, verifyTotp } from '../lib/cloud/auth'
import { oauthProviders, PASSWORD_MIN, requestPasswordReset, signIn, signInWithProvider, signOut, signUp, updatePassword, verifyTotp, type OAuthProvider } from '../lib/cloud/auth'
import { USERNAME_RE } from '../lib/cloud/social'
import { cx } from '../lib/utils'
import { RANDOM_USERNAME } from './social/WelcomeProfile'
@@ -78,7 +78,17 @@ export default function AuthScreen({
const cleanUsername = username.trim().replace(/^@/, '').toLowerCase()
const usernameOk = USERNAME_RE.test(cleanUsername) && !RANDOM_USERNAME.test(cleanUsername)
// Retour arrière depuis Google (page restaurée du cache) : les boutons ne restent pas bloqués
// « Continuer avec Apple » : affiché seulement une fois Apple activé dans Supabase
const [appleOn, setAppleOn] = useState(false)
useEffect(() => {
let alive = true
void oauthProviders().then((p) => alive && setAppleOn(!!p.apple))
return () => {
alive = false
}
}, [])
// Retour arrière depuis Google ou Apple (page restaurée du cache) : les boutons ne restent pas bloqués
useEffect(() => {
const onShow = (e: PageTransitionEvent) => {
if (e.persisted) setBusy(false)
@@ -93,12 +103,12 @@ export default function AuthScreen({
setInfo(undefined)
}
const google = async () => {
const oauth = async (provider: OAuthProvider) => {
setError(undefined)
setInfo(undefined)
setBusy(true)
try {
await signInWithGoogle()
await signInWithProvider(provider)
} catch (err) {
setError((err as Error).message)
setBusy(false)
@@ -153,9 +163,16 @@ export default function AuthScreen({
{mode !== 'forgot' && (
<>
<button type="button" onClick={google} disabled={busy} className="btn btn-ghost w-full py-3">
<button type="button" onClick={() => oauth('google')} disabled={busy} className="btn btn-ghost w-full py-3">
{t('auth.google')}
</button>
{appleOn && (
// Bouton Apple : logo et libellé imposés par Apple, même taille que le bouton Google
<button type="button" onClick={() => oauth('apple')} disabled={busy} className="btn mt-2 w-full bg-ink py-3 text-bg">
<AppleLogo />
{t('auth.apple')}
</button>
)}
<div className="my-5 flex items-center gap-3 text-xs text-ink-3">
<span className="h-px flex-1 bg-line" />
{t('auth.or')}
@@ -220,7 +237,7 @@ export default function AuthScreen({
</p>
)}
{/* Acceptation des conditions, avant de créer un compte (aussi valable pour « Continuer avec Google ») */}
{/* Acceptation des conditions, avant de créer un compte (aussi valable pour Google et Apple) */}
{mode !== 'forgot' && (
<p className="text-center text-xs leading-relaxed text-ink-3">
{t('auth.consent')}{' '}
@@ -380,3 +397,12 @@ export function LegalLinks() {
</nav>
)
}
/** Logo Apple (bouton « Continuer avec Apple »), à la couleur du texte. */
function AppleLogo() {
return (
<svg viewBox="0 0 170 170" width="17" height="17" fill="currentColor" aria-hidden="true">
<path d="M150.37 130.25c-2.45 5.66-5.35 10.87-8.71 15.66-4.58 6.53-8.33 11.05-11.22 13.56-4.48 4.12-9.28 6.23-14.42 6.35-3.69 0-8.14-1.05-13.32-3.18-5.2-2.12-9.97-3.17-14.34-3.17-4.58 0-9.49 1.05-14.75 3.17-5.26 2.13-9.5 3.24-12.74 3.35-4.93.21-9.84-1.96-14.75-6.52-3.13-2.73-7.05-7.41-11.74-14.04-5.03-7.08-9.17-15.29-12.41-24.65-3.47-10.11-5.21-19.9-5.21-29.38 0-10.86 2.35-20.22 7.05-28.07 3.69-6.3 8.61-11.28 14.76-14.93s12.79-5.51 19.95-5.63c3.92 0 9.05 1.21 15.43 3.59 6.36 2.39 10.45 3.6 12.24 3.6 1.34 0 5.88-1.42 13.57-4.24 7.28-2.62 13.42-3.7 18.45-3.28 13.63 1.1 23.87 6.47 30.68 16.15-12.19 7.39-18.22 17.73-18.1 31 .11 10.34 3.86 18.94 11.23 25.77 3.34 3.17 7.07 5.62 11.22 7.36-.9 2.61-1.85 5.11-2.86 7.51zM119.11 7.24c0 8.1-2.96 15.67-8.86 22.67-7.12 8.32-15.73 13.13-25.07 12.37-.12-.97-.19-1.99-.19-3.07 0-7.78 3.39-16.1 9.4-22.91 3-3.45 6.82-6.31 11.45-8.6 4.62-2.25 8.99-3.5 13.1-3.71.12 1.08.17 2.17.17 3.24z" />
</svg>
)
}
+76
View File
@@ -0,0 +1,76 @@
import { Plus, Share, SquarePlus, X } from 'lucide-react'
import { useState } from 'react'
import { t } from '../i18n'
import { canInstallOnIos } from '../lib/install'
/**
* Installer Bobinoo sur un iPhone ou un iPad : il n'y a pas de bouton d'installation sur iOS, il faut passer
* par le menu Partager du navigateur. Ces trois étapes l'expliquent.
*/
export function InstallSteps() {
const steps = [
{ icon: <Share size={16} />, text: t('install.step1') },
{ icon: <SquarePlus size={16} />, text: t('install.step2') },
{ icon: <Plus size={16} />, text: t('install.step3') },
]
return (
<ol className="space-y-3">
{steps.map((s, i) => (
<li key={i} className="flex items-start gap-3 text-sm leading-relaxed text-ink-2">
<span className="grid size-7 shrink-0 place-items-center rounded-full border border-line-strong text-ink" aria-hidden>
{s.icon}
</span>
<span className="pt-0.5">{s.text}</span>
</li>
))}
</ol>
)
}
const HIDDEN_KEY = 'azuucine:install-hint'
/** Carte de l'accueil, dans le navigateur d'un iPhone ou d'un iPad seulement, masquable pour de bon. */
export function InstallHint() {
const [hidden, setHidden] = useState(() => {
if (!canInstallOnIos()) return true
try {
return localStorage.getItem(HIDDEN_KEY) === '1'
} catch {
return false
}
})
const [open, setOpen] = useState(false)
if (hidden) return null
const hide = () => {
setHidden(true)
try {
localStorage.setItem(HIDDEN_KEY, '1')
} catch {
/* stockage bloqué : la carte reviendra à la prochaine visite */
}
}
return (
<section className="card mb-6 p-4" aria-label={t('install.title')}>
<div className="flex items-start gap-3">
<div className="min-w-0 flex-1">
<h2 className="font-semibold">{t('install.title')}</h2>
<p className="mt-1 text-sm text-ink-2">{t('install.hint')}</p>
</div>
<button type="button" onClick={hide} aria-label={t('netPill.hide')} className="-me-1.5 -mt-1.5 grid size-8 shrink-0 place-items-center rounded-full text-ink-3 active:bg-surface-2">
<X size={16} />
</button>
</div>
{open ? (
<div className="mt-4">
<InstallSteps />
</div>
) : (
<button type="button" onClick={() => setOpen(true)} className="btn btn-ghost mt-3 px-3 py-2 text-sm">
{t('install.how')}
</button>
)}
</section>
)
}
+8
View File
@@ -1181,6 +1181,14 @@ const dict: Translations = {
"notifPrefs.friend_review": "مراجعة جديدة",
"notifPrefs.friend_started": "بدء مسلسل",
"notifPrefs.friend_added": "إضافة إلى «للمشاهدة»",
"install.title": "تثبيت Bobinoo",
"install.hint": "أضف Bobinoo إلى شاشتك الرئيسية: سيفتح كتطبيق بملء الشاشة.",
"install.how": "اعرف الطريقة",
"install.step1": "اضغط على زر المشاركة (المربع الذي فيه سهم للأعلى). في أجهزة iPhone الحديثة تجده في القائمة «…».",
"install.step2": "اختر «إضافة إلى الشاشة الرئيسية».",
"install.step3": "اضغط «إضافة»: ستظهر أيقونة Bobinoo بجانب تطبيقاتك الأخرى.",
"auth.apple": "المتابعة باستخدام Apple",
"auth.err.apple": "تعذّر تسجيل الدخول باستخدام Apple. حاول مرة أخرى.",
}
export default dict
+8
View File
@@ -1032,6 +1032,14 @@ const dict: Translations = {
"notifPrefs.friend_review": "Neue Kritik",
"notifPrefs.friend_started": "Serie angefangen",
"notifPrefs.friend_added": "Zu „Geplant“ hinzugefügt",
"install.title": "Bobinoo installieren",
"install.hint": "Füge Bobinoo zu deinem Home-Bildschirm hinzu: Es öffnet sich dann wie eine App, im Vollbild.",
"install.how": "So geht’s",
"install.step1": "Tippe auf die Teilen-Taste (das Quadrat mit dem Pfeil nach oben). Auf neueren iPhones findest du sie im Menü „…“.",
"install.step2": "Wähle „Zum Home-Bildschirm“.",
"install.step3": "Tippe auf „Hinzufügen“: Das Bobinoo-Symbol erscheint bei deinen anderen Apps.",
"auth.apple": "Mit Apple fortfahren",
"auth.err.apple": "Die Anmeldung mit Apple ist fehlgeschlagen. Versuch es erneut.",
}
export default dict
+8
View File
@@ -1032,6 +1032,14 @@ const dict: Translations = {
"notifPrefs.friend_review": "New review",
"notifPrefs.friend_started": "Started a series",
"notifPrefs.friend_added": "Added to “To watch”",
"install.title": "Install Bobinoo",
"install.hint": "Add Bobinoo to your Home Screen: it opens like an app, full screen.",
"install.how": "Show me how",
"install.step1": "Tap the Share button (the square with an arrow pointing up). On recent iPhones, it’s in the “…” menu.",
"install.step2": "Choose “Add to Home Screen”.",
"install.step3": "Tap “Add”: the Bobinoo icon appears with your other apps.",
"auth.apple": "Continue with Apple",
"auth.err.apple": "Sign in with Apple failed. Try again.",
}
export default dict
+8
View File
@@ -1032,6 +1032,14 @@ const dict: Translations = {
"notifPrefs.friend_review": "Nueva reseña",
"notifPrefs.friend_started": "Serie empezada",
"notifPrefs.friend_added": "Añadido a «Por ver»",
"install.title": "Instalar Bobinoo",
"install.hint": "Añade Bobinoo a tu pantalla de inicio: se abrirá como una app, a pantalla completa.",
"install.how": "Ver cómo",
"install.step1": "Toca el botón Compartir (el cuadrado con una flecha hacia arriba). En los iPhone más recientes está en el menú «…».",
"install.step2": "Elige «Añadir a pantalla de inicio».",
"install.step3": "Toca «Añadir»: el icono de Bobinoo aparecerá junto a tus otras apps.",
"auth.apple": "Continuar con Apple",
"auth.err.apple": "No se pudo iniciar sesión con Apple. Inténtalo de nuevo.",
}
export default dict
+8
View File
@@ -1034,6 +1034,14 @@ const dict = {
"notifPrefs.friend_review": "Nouvel avis",
"notifPrefs.friend_started": "Série commencée",
"notifPrefs.friend_added": "Ajout à « À voir »",
"install.title": "Installer Bobinoo",
"install.hint": "Ajoute Bobinoo à ton écran d'accueil : elle s'ouvrira comme une app, en plein écran.",
"install.how": "Voir comment",
"install.step1": "Touche le bouton Partager (le carré avec une flèche vers le haut). Sur les derniers iPhone, il se trouve dans le menu « … ».",
"install.step2": "Choisis « Sur l'écran d'accueil ».",
"install.step3": "Touche « Ajouter » : l'icône Bobinoo apparaît avec tes autres apps.",
"auth.apple": "Continuer avec Apple",
"auth.err.apple": "La connexion avec Apple a échoué. Réessaie.",
}
export default dict
+8
View File
@@ -1032,6 +1032,14 @@ const dict: Translations = {
"notifPrefs.friend_review": "नई समीक्षा",
"notifPrefs.friend_started": "सीरीज़ शुरू की",
"notifPrefs.friend_added": "“देखना है” में जोड़ा",
"install.title": "Bobinoo इंस्टॉल करें",
"install.hint": "Bobinoo को अपनी होम स्क्रीन पर जोड़ें: यह ऐप की तरह, फ़ुल स्क्रीन में खुलेगा।",
"install.how": "तरीका देखें",
"install.step1": "शेयर बटन (ऊपर की ओर तीर वाला चौकोर) पर टैप करें। नए iPhone में यह “…” मेन्यू में होता है।",
"install.step2": "“होम स्क्रीन में जोड़ें” चुनें।",
"install.step3": "“जोड़ें” पर टैप करें: Bobinoo का आइकन आपके दूसरे ऐप्स के साथ दिखेगा।",
"auth.apple": "Apple के साथ जारी रखें",
"auth.err.apple": "Apple से साइन इन नहीं हो सका। फिर से कोशिश करें।",
}
export default dict
+8
View File
@@ -1032,6 +1032,14 @@ const dict: Translations = {
"notifPrefs.friend_review": "Ulasan baru",
"notifPrefs.friend_started": "Mulai menonton serial",
"notifPrefs.friend_added": "Ditambahkan ke “Mau ditonton”",
"install.title": "Instal Bobinoo",
"install.hint": "Tambahkan Bobinoo ke Layar Utama: Bobinoo akan terbuka layar penuh, seperti app biasa.",
"install.how": "Lihat caranya",
"install.step1": "Ketuk tombol Bagikan (kotak dengan panah ke atas). Di iPhone terbaru, tombol ini ada di menu “…”.",
"install.step2": "Pilih “Tambah ke Layar Utama”.",
"install.step3": "Ketuk “Tambah”: ikon Bobinoo muncul bersama app lainnya.",
"auth.apple": "Lanjutkan dengan Apple",
"auth.err.apple": "Gagal masuk dengan Apple. Coba lagi.",
}
export default dict
+8
View File
@@ -1032,6 +1032,14 @@ const dict: Translations = {
"notifPrefs.friend_review": "Nuova recensione",
"notifPrefs.friend_started": "Serie iniziata",
"notifPrefs.friend_added": "Aggiunto a «Da vedere»",
"install.title": "Installa Bobinoo",
"install.hint": "Aggiungi Bobinoo alla schermata Home: si aprirà come un’app, a schermo intero.",
"install.how": "Scopri come",
"install.step1": "Tocca il pulsante Condividi (il quadrato con la freccia verso l’alto). Sugli iPhone più recenti si trova nel menu «…».",
"install.step2": "Scegli «Aggiungi alla schermata Home».",
"install.step3": "Tocca «Aggiungi»: l’icona di Bobinoo comparirà insieme alle altre app.",
"auth.apple": "Continua con Apple",
"auth.err.apple": "Accesso con Apple non riuscito. Riprova.",
}
export default dict
+8
View File
@@ -1032,6 +1032,14 @@ const dict: Translations = {
"notifPrefs.friend_review": "新しいレビュー",
"notifPrefs.friend_started": "シリーズを見始めた",
"notifPrefs.friend_added": "「見たい」に追加",
"install.title": "Bobinoo をインストール",
"install.hint": "Bobinoo をホーム画面に追加すると、アプリのように全画面で開けます。",
"install.how": "方法を見る",
"install.step1": "共有ボタン(上向き矢印のついた四角)をタップします。最近の iPhone では「…」メニューの中にあります。",
"install.step2": "「ホーム画面に追加」を選びます。",
"install.step3": "「追加」をタップすると、ほかのアプリと並んで Bobinoo のアイコンが表示されます。",
"auth.apple": "Apple で続ける",
"auth.err.apple": "Apple でのサインインに失敗しました。もう一度お試しください。",
}
export default dict
+8
View File
@@ -1032,6 +1032,14 @@ const dict: Translations = {
"notifPrefs.friend_review": "새 리뷰",
"notifPrefs.friend_started": "시리즈 시청 시작",
"notifPrefs.friend_added": "'볼 예정'에 추가",
"install.title": "Bobinoo 설치하기",
"install.hint": "Bobinoo를 홈 화면에 추가하면 앱처럼 전체 화면으로 열려요.",
"install.how": "방법 보기",
"install.step1": "공유 버튼(위쪽 화살표가 있는 네모)을 탭하세요. 최신 iPhone에서는 '…' 메뉴 안에 있어요.",
"install.step2": "'홈 화면에 추가'를 선택하세요.",
"install.step3": "'추가'를 탭하면 다른 앱들 사이에 Bobinoo 아이콘이 나타나요.",
"auth.apple": "Apple로 계속하기",
"auth.err.apple": "Apple 로그인에 실패했어요. 다시 시도해 주세요.",
}
export default dict
+8
View File
@@ -1032,6 +1032,14 @@ const dict: Translations = {
"notifPrefs.friend_review": "Nieuwe recensie",
"notifPrefs.friend_started": "Serie begonnen",
"notifPrefs.friend_added": "Toegevoegd aan ‘Nog kijken’",
"install.title": "Bobinoo installeren",
"install.hint": "Zet Bobinoo op je beginscherm: het opent dan als een app, op volledig scherm.",
"install.how": "Laat zien hoe",
"install.step1": "Tik op de deelknop (het vierkant met een pijl omhoog). Op nieuwere iPhones staat die in het menu ‘…’.",
"install.step2": "Kies ‘Zet op beginscherm’.",
"install.step3": "Tik op ‘Voeg toe’: het Bobinoo-icoon verschijnt tussen je andere apps.",
"auth.apple": "Doorgaan met Apple",
"auth.err.apple": "Inloggen met Apple is mislukt. Probeer het opnieuw.",
}
export default dict
+8
View File
@@ -1130,6 +1130,14 @@ const dict: Translations = {
"notifPrefs.friend_review": "Nowa recenzja",
"notifPrefs.friend_started": "Rozpoczęty serial",
"notifPrefs.friend_added": "Dodano do „Do obejrzenia”",
"install.title": "Zainstaluj Bobinoo",
"install.hint": "Dodaj Bobinoo do ekranu początkowego: otworzy się jak aplikacja, na pełnym ekranie.",
"install.how": "Pokaż jak",
"install.step1": "Stuknij przycisk Udostępnij (kwadrat ze strzałką w górę). W nowszych iPhone’ach znajdziesz go w menu „…”.",
"install.step2": "Wybierz „Do ekranu początkowego”.",
"install.step3": "Stuknij „Dodaj”: ikona Bobinoo pojawi się obok innych aplikacji.",
"auth.apple": "Kontynuuj z Apple",
"auth.err.apple": "Logowanie przez Apple nie powiodło się. Spróbuj ponownie.",
}
export default dict
+8
View File
@@ -1032,6 +1032,14 @@ const dict: Translations = {
"notifPrefs.friend_review": "Nova crítica",
"notifPrefs.friend_started": "Série começada",
"notifPrefs.friend_added": "Adicionado a «Quero ver»",
"install.title": "Instalar o Bobinoo",
"install.hint": "Adicione o Bobinoo à sua Tela de Início: ele abre como um app, em tela cheia.",
"install.how": "Ver como",
"install.step1": "Toque no botão Compartilhar (o quadrado com uma seta para cima). Nos iPhones mais recentes, ele fica no menu “…”.",
"install.step2": "Escolha “Adicionar à Tela de Início”.",
"install.step3": "Toque em “Adicionar”: o ícone do Bobinoo aparece junto com seus outros apps.",
"auth.apple": "Continuar com a Apple",
"auth.err.apple": "Não foi possível entrar com a Apple. Tente de novo.",
}
export default dict
+8
View File
@@ -1130,6 +1130,14 @@ const dict: Translations = {
"notifPrefs.friend_review": "Новый отзыв",
"notifPrefs.friend_started": "Начатый сериал",
"notifPrefs.friend_added": "Добавлено в «В планах»",
"install.title": "Установить Bobinoo",
"install.hint": "Добавь Bobinoo на экран «Домой»: он будет открываться как приложение, на весь экран.",
"install.how": "Показать как",
"install.step1": "Нажми кнопку «Поделиться» (квадрат со стрелкой вверх). На новых iPhone она в меню «…».",
"install.step2": "Выбери «На экран „Домой“».",
"install.step3": "Нажми «Добавить»: значок Bobinoo появится рядом с другими приложениями.",
"auth.apple": "Продолжить с Apple",
"auth.err.apple": "Не удалось войти через Apple. Попробуй ещё раз.",
}
export default dict
+8
View File
@@ -1032,6 +1032,14 @@ const dict: Translations = {
"notifPrefs.friend_review": "รีวิวใหม่",
"notifPrefs.friend_started": "เริ่มดูซีรีส์",
"notifPrefs.friend_added": "เพิ่มใน “อยากดู”",
"install.title": "ติดตั้ง Bobinoo",
"install.hint": "เพิ่ม Bobinoo ไปยังหน้าจอโฮม แล้วจะเปิดแบบเต็มจอเหมือนแอป",
"install.how": "ดูวิธีทำ",
"install.step1": "แตะปุ่มแชร์ (สี่เหลี่ยมที่มีลูกศรชี้ขึ้น) ใน iPhone รุ่นใหม่ ปุ่มนี้อยู่ในเมนู “…”",
"install.step2": "เลือก “เพิ่มไปยังหน้าจอโฮม”",
"install.step3": "แตะ “เพิ่ม” แล้วไอคอน Bobinoo จะปรากฏพร้อมแอปอื่นๆ ของคุณ",
"auth.apple": "ดำเนินการต่อด้วย Apple",
"auth.err.apple": "ลงชื่อเข้าใช้ด้วย Apple ไม่สำเร็จ ลองอีกครั้ง",
}
export default dict
+8
View File
@@ -1032,6 +1032,14 @@ const dict: Translations = {
"notifPrefs.friend_review": "Yeni yorum",
"notifPrefs.friend_started": "Başlanan dizi",
"notifPrefs.friend_added": "“İzlenecek” listesine ekleme",
"install.title": "Bobinoo’yu yükle",
"install.hint": "Bobinoo’yu ana ekranına ekle: bir uygulama gibi, tam ekran açılır.",
"install.how": "Nasıl yapılır",
"install.step1": "Paylaş düğmesine dokun (yukarı ok olan kare). Yeni iPhone’larda “…” menüsündedir.",
"install.step2": "“Ana Ekrana Ekle”yi seç.",
"install.step3": "“Ekle”ye dokun: Bobinoo simgesi diğer uygulamalarının yanında görünür.",
"auth.apple": "Apple ile devam et",
"auth.err.apple": "Apple ile giriş başarısız oldu. Tekrar dene.",
}
export default dict
+8
View File
@@ -1032,6 +1032,14 @@ const dict: Translations = {
"notifPrefs.friend_review": "Đánh giá mới",
"notifPrefs.friend_started": "Bắt đầu xem phim bộ",
"notifPrefs.friend_added": "Thêm vào “Sẽ xem”",
"install.title": "Cài đặt Bobinoo",
"install.hint": "Thêm Bobinoo vào Màn hình chính: Bobinoo sẽ mở toàn màn hình như một app.",
"install.how": "Xem cách làm",
"install.step1": "Chạm vào nút Chia sẻ (hình vuông có mũi tên hướng lên). Trên các iPhone mới, nút này nằm trong menu “…”.",
"install.step2": "Chọn “Thêm vào MH chính”.",
"install.step3": "Chạm “Thêm”: biểu tượng Bobinoo sẽ xuất hiện cùng các app khác của bạn.",
"auth.apple": "Tiếp tục với Apple",
"auth.err.apple": "Đăng nhập bằng Apple không thành công. Hãy thử lại.",
}
export default dict
+8
View File
@@ -1032,6 +1032,14 @@ const dict: Translations = {
"notifPrefs.friend_review": "新评价",
"notifPrefs.friend_started": "开始看剧",
"notifPrefs.friend_added": "加入“想看”",
"install.title": "安装 Bobinoo",
"install.hint": "把 Bobinoo 添加到主屏幕,它会像 App 一样全屏打开。",
"install.how": "查看方法",
"install.step1": "轻点“分享”按钮(带向上箭头的方框)。在较新的 iPhone 上,它位于“…”菜单中。",
"install.step2": "选择“添加到主屏幕”。",
"install.step3": "轻点“添加”:Bobinoo 图标会出现在你的其他 App 旁边。",
"auth.apple": "通过 Apple 继续",
"auth.err.apple": "使用 Apple 登录失败,请重试。",
}
export default dict
+2 -1
View File
@@ -1,5 +1,6 @@
import { getLang, t } from '../i18n'
import type { ThemeMode } from '../types'
import { isStandalone } from './install'
/** Adresse de contact de l'éditeur (bugs, signalements, questions). */
export const CONTACT_EMAIL = 'contact@bobinoo.org'
@@ -59,7 +60,7 @@ export const currentRoute = () => (location.hash.match(/^#\/[a-z-]{1,20}/i)?.[0]
*/
export function techInfo(theme: ThemeMode): Record<string, string> {
const { browser, os } = browserInfo()
const standalone = window.matchMedia?.('(display-mode: standalone)').matches || (navigator as { standalone?: boolean }).standalone === true
const standalone = isStandalone()
return {
version: `${APP_VERSION} (${buildLabel()})`,
browser,
+34 -13
View File
@@ -226,24 +226,26 @@ export async function signOut(): Promise<void> {
}
}
// ───────────────────────────── Connexion avec Google (OAuth + PKCE) ─────────────────────────────
// Google renvoie vers l'app avec un code à usage unique (?code=…) que seul cet appareil peut échanger,
// ───────────────────────── Connexion avec Google ou Apple (OAuth + PKCE) ─────────────────────────
// Le service renvoie vers l'app avec un code à usage unique (?code=…) que seul cet appareil peut échanger,
// grâce au « vérificateur » gardé ici le temps de l'aller-retour. Aucun jeton ne passe dans l'adresse.
export type OAuthProvider = 'google' | 'apple'
const VERIFIER_KEY = 'azuucine:pkce'
const b64url = (bytes: Uint8Array) => btoa(String.fromCharCode(...bytes)).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '')
export async function signInWithGoogle(): Promise<void> {
export async function signInWithProvider(provider: OAuthProvider): Promise<void> {
const verifier = b64url(crypto.getRandomValues(new Uint8Array(48)))
const challenge = b64url(new Uint8Array(await crypto.subtle.digest('SHA-256', new TextEncoder().encode(verifier))))
try {
localStorage.setItem(VERIFIER_KEY, JSON.stringify({ verifier, at: Date.now() }))
localStorage.setItem(VERIFIER_KEY, JSON.stringify({ verifier, at: Date.now(), provider }))
} catch {
throw new AuthError(t('auth.err.storage'))
}
const params = new URLSearchParams({
provider: 'google',
provider,
redirect_to: appUrl(),
code_challenge: challenge,
code_challenge_method: 's256',
@@ -251,20 +253,38 @@ export async function signInWithGoogle(): Promise<void> {
location.assign(`${SUPABASE_URL}/auth/v1/authorize?${params}`)
}
/** Vérificateur gardé pendant l'aller-retour vers Google (null s'il n'y en a pas). */
function readVerifier(): { verifier?: unknown; at?: unknown } | null {
let providers: Promise<Partial<Record<OAuthProvider, boolean>>> | undefined
/**
* Fournisseurs de connexion activés dans Supabase (Authentication → Providers). Le bouton Apple n'apparaît
* qu'une fois Apple configuré là-bas : rien à redéployer ce jour-là. Hors ligne ou erreur : aucun.
*/
export function oauthProviders(): Promise<Partial<Record<OAuthProvider, boolean>>> {
providers ??= withTimeout((signal) =>
fetch(`${SUPABASE_URL}/auth/v1/settings`, { headers: { apikey: SUPABASE_ANON_KEY }, credentials: 'omit', referrerPolicy: 'no-referrer', signal }),
)
.then((res): Promise<{ external?: Record<string, unknown> }> => (res.ok ? res.json() : Promise.resolve({})))
.then((d) => ({ google: d.external?.google === true, apple: d.external?.apple === true }))
.catch(() => {
providers = undefined // nouvel essai à la prochaine ouverture
return {}
})
return providers
}
/** Vérificateur gardé pendant l'aller-retour vers Google ou Apple (null s'il n'y en a pas). */
function readVerifier(): { verifier?: unknown; at?: unknown; provider?: unknown } | null {
try {
const raw = localStorage.getItem(VERIFIER_KEY)
const parsed: unknown = raw ? JSON.parse(raw) : null
return parsed && typeof parsed === 'object' ? (parsed as { verifier?: unknown; at?: unknown }) : null
return parsed && typeof parsed === 'object' ? (parsed as { verifier?: unknown; at?: unknown; provider?: unknown }) : null
} catch {
return null
}
}
/**
* Retour de Google : adresse avec ?code=… (ou ?error=…), seulement si une connexion Google a été lancée
* depuis cet appareil (vérificateur présent) — une autre adresse avec ?code= n'est pas un retour de Google.
* Retour de Google ou d'Apple : adresse avec ?code=… (ou ?error=…), seulement si une connexion a été lancée
* depuis cet appareil (vérificateur présent). Une autre adresse avec ?code= n'est pas un retour de connexion.
*/
export const hasOAuthRedirect = () => /[?&](code|error)=/.test(location.search) && readVerifier() !== null
@@ -278,17 +298,18 @@ async function consumeOAuthRedirect(): Promise<{ error?: string }> {
verifier: typeof stored?.verifier === 'string' ? stored.verifier : undefined,
at: typeof stored?.at === 'number' ? stored.at : undefined,
}
const failed = t(stored?.provider === 'apple' ? 'auth.err.apple' : 'auth.err.google')
try {
localStorage.removeItem(VERIFIER_KEY)
} catch {
/* ignore */
}
if (oauthError) return { error: t('auth.err.google') }
if (oauthError) return { error: failed }
// Vérificateur absent ou trop vieux (> 10 min) : on ne tente rien
if (!/^[A-Za-z0-9_-]{43,128}$/.test(saved.verifier ?? '') || !saved.at || Date.now() - saved.at > 600_000) {
return { error: t('auth.err.google') }
return { error: failed }
}
if (!/^[A-Za-z0-9_-]{8,256}$/.test(code)) return { error: t('auth.err.google') }
if (!/^[A-Za-z0-9_-]{8,256}$/.test(code)) return { error: failed }
try {
const data = await gotrue('/token?grant_type=pkce', { body: { auth_code: code, code_verifier: saved.verifier } })
const s = toSession(data)
+13
View File
@@ -0,0 +1,13 @@
/** iPhone, iPad ou iPod (iPadOS se présente comme un Mac : on le reconnaît à son écran tactile). */
export function isAppleMobile(): boolean {
const ua = navigator.userAgent
return /iPhone|iPad|iPod/.test(ua) || (/Macintosh/.test(ua) && navigator.maxTouchPoints > 1)
}
/** App ouverte depuis l'écran d'accueil (déjà installée). */
export function isStandalone(): boolean {
return window.matchMedia?.('(display-mode: standalone)').matches || (navigator as { standalone?: boolean }).standalone === true
}
/** Guide « Installer sur l'iPhone » : utile seulement dans le navigateur d'un iPhone ou d'un iPad. */
export const canInstallOnIos = () => isAppleMobile() && !isStandalone()
+3
View File
@@ -10,6 +10,7 @@ import HomeHero, { ContinueCard } from '../components/HomeHero'
import { progressView } from '../lib/rewatch'
import type { Tab } from '../components/BottomNav'
import { EmptyState, LinkArrow, PageHeader, SectionTitle } from '../components/ui'
import { InstallHint } from '../components/InstallGuide'
import LatestReleases from '../components/LatestReleases'
import type { SearchResult } from '../lib/catalogApi'
import { CACHE_EVENT, isCaughtUp, loadAiring, needsCheck, refreshAiring, saveAiring, trackable } from '../lib/airing'
@@ -216,6 +217,8 @@ export default memo(function HomePage({ onOpen, onAdd, onNavigate, onRoulette, o
}
/>
<InstallHint />
{loading && items.length === 0 ? (
// Bibliothèque pas encore lue : la place de la bannière est réservée (rien ne saute ensuite)
<div className="aspect-video w-full bg-surface-2 lg:aspect-auto lg:h-[22rem]" aria-hidden />
+12
View File
@@ -12,6 +12,8 @@ import { THEME_MODES } from '../lib/theme'
import { cx } from '../lib/utils'
import { useMedia } from '../store'
import { BugReportRow } from '../components/moderation/BugReport'
import { InstallSteps } from '../components/InstallGuide'
import { canInstallOnIos } from '../lib/install'
import { APP_VERSION, buildLabel } from '../lib/appInfo'
// Assistant d'import (lecture des fichiers, recherche des titres) : chargé seulement quand on l'ouvre
@@ -258,6 +260,16 @@ export default function SettingsPage() {
</>
)}
{canInstallOnIos() && (
<>
<SectionTitle>{t('install.title')}</SectionTitle>
<div className="card p-4">
<p className="mb-4 text-sm text-ink-2">{t('install.hint')}</p>
<InstallSteps />
</div>
</>
)}
<SectionTitle>{t('settings.about')}</SectionTitle>
<div className="card divide-y divide-line overflow-hidden">
<BugReportRow />