Skip to content

Commit 5425068

Browse files
authored
🔨 chore: improve OIDC code challenge workflow (#7397)
* improve code * improve code * fix auth route issue * fix Interaction not find Session * fix all flow * fix error * refactor * fix oidc token flow * fix oidc token flow * update i18n * improve auth page * fix test * fix test * refactor components
1 parent f3d5d40 commit 5425068

File tree

33 files changed

+665
-473
lines changed

33 files changed

+665
-473
lines changed

Diff for: .eslintrc.js

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ config.rules['unicorn/prefer-spread'] = 0;
1717
config.rules['unicorn/catch-error-name'] = 0;
1818
config.rules['unicorn/no-array-for-each'] = 0;
1919
config.rules['unicorn/prefer-number-properties'] = 0;
20+
config.rules['unicorn/no-array-callback-reference'] = 0;
2021

2122
config.overrides = [
2223
{

Diff for: locales/ar/oauth.json

+7-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"accept": "موافقة",
55
"deny": "رفض"
66
},
7-
"description": "تطبيق {clientId} يطلب الوصول إلى حسابك في LobeChat",
7+
"description": "تطبيق {{clientName}} يطلب إذن حسابك",
88
"error": {
99
"sessionInvalid": {
1010
"message": "جلسة التفويض منتهية أو غير صالحة، يرجى إعادة بدء عملية التفويض.",
@@ -16,16 +16,17 @@
1616
"title": "نوع التفاعل غير مدعوم"
1717
}
1818
},
19-
"permissionsTitle": "يطلب التطبيق الأذونات التالية:",
19+
"permissionsTitle": "طلب الأذونات التالية:",
20+
"redirectUri": "سيتم إعادة التوجيه إلى بعد نجاح التفويض",
2021
"scope": {
2122
"email": "الوصول إلى عنوان بريدك الإلكتروني",
22-
"offline_access": "الاستمرار في الوصول إلى بياناتك أثناء عدم الاتصال",
23+
"offline_access": "السماح للتطبيق بالوصول إلى بياناتك",
2324
"openid": "استخدام حسابك في LobeChat للتحقق من الهوية",
2425
"profile": "الوصول إلى معلومات ملفك الشخصي الأساسية (الاسم، الصورة، إلخ)",
25-
"sync:read": "قراءة بيانات المزامنة الخاصة بك",
26-
"sync:write": "كتابة وتحديث بيانات المزامنة الخاصة بك"
26+
"sync-read": "قراءة بيانات المزامنة الخاصة بك",
27+
"sync-write": "كتابة وتحديث بيانات المزامنة الخاصة بك"
2728
},
28-
"title": "طلب التفويض"
29+
"title": "تفويض {{clientName}}"
2930
},
3031
"failed": {
3132
"backToHome": "العودة إلى الصفحة الرئيسية",

Diff for: locales/bg-BG/oauth.json

+7-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"accept": "Разреши",
55
"deny": "Отказ"
66
},
7-
"description": "Приложението {clientId} иска достъп до вашия LobeChat акаунт",
7+
"description": "Приложението {{clientName}} иска разрешение за вашия акаунт",
88
"error": {
99
"sessionInvalid": {
1010
"message": "Сесията за разрешение е изтекла или невалидна, моля, стартирайте отново процеса на разрешение.",
@@ -16,16 +16,17 @@
1616
"title": "Неподдържан тип взаимодействие"
1717
}
1818
},
19-
"permissionsTitle": "Приложението иска следните разрешения:",
19+
"permissionsTitle": "Искаме следните разрешения:",
20+
"redirectUri": "Ще бъдете пренасочени след успешното разрешение",
2021
"scope": {
2122
"email": "Достъп до вашия имейл адрес",
22-
"offline_access": "Достъп до вашите данни, докато сте офлайн",
23+
"offline_access": "Позволете на клиента да получи достъп до вашите данни",
2324
"openid": "Аутентификация с вашия LobeChat акаунт",
2425
"profile": "Достъп до основната ви информация (име, аватар и др.)",
25-
"sync:read": "Четене на вашите синхронизирани данни",
26-
"sync:write": "Записване и актуализиране на вашите синхронизирани данни"
26+
"sync-read": "Четене на вашите синхронизирани данни",
27+
"sync-write": "Записване и актуализиране на вашите синхронизирани данни"
2728
},
28-
"title": "Заявка за разрешение"
29+
"title": "Разрешаване на {{clientName}}"
2930
},
3031
"failed": {
3132
"backToHome": "Върнете се на началната страница",

Diff for: locales/de-DE/oauth.json

+7-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"accept": "Zustimmen",
55
"deny": "Ablehnen"
66
},
7-
"description": "Die Anwendung {clientId} fordert Zugriff auf Ihr LobeChat-Konto an",
7+
"description": "Die Anwendung {{clientName}} beantragt die Autorisierung Ihres Kontos",
88
"error": {
99
"sessionInvalid": {
1010
"message": "Die Autorisierungssitzung ist abgelaufen oder ungültig. Bitte starten Sie den Autorisierungsprozess erneut.",
@@ -16,16 +16,17 @@
1616
"title": "Nicht unterstützter Interaktionstyp"
1717
}
1818
},
19-
"permissionsTitle": "Die Anwendung fordert die folgenden Berechtigungen an:",
19+
"permissionsTitle": "Anforderung der folgenden Berechtigungen:",
20+
"redirectUri": "Nach erfolgreicher Autorisierung werden Sie umgeleitet zu",
2021
"scope": {
2122
"email": "Zugriff auf Ihre E-Mail-Adresse",
22-
"offline_access": "Zugriff auf Ihre Daten auch im Offline-Modus",
23+
"offline_access": "Erlauben Sie dem Client, auf Ihre Daten zuzugreifen",
2324
"openid": "Authentifizierung mit Ihrem LobeChat-Konto",
2425
"profile": "Zugriff auf Ihre Profilinformationen (Name, Avatar usw.)",
25-
"sync:read": "Lesen Ihrer Synchronisierungsdaten",
26-
"sync:write": "Schreiben und Aktualisieren Ihrer Synchronisierungsdaten"
26+
"sync-read": "Lesen Sie Ihre synchronisierten Daten",
27+
"sync-write": "Schreiben und Aktualisieren Sie Ihre synchronisierten Daten"
2728
},
28-
"title": "Autorisierungsanfrage"
29+
"title": "Autorisierung von {{clientName}}"
2930
},
3031
"failed": {
3132
"backToHome": "Zurück zur Startseite",

Diff for: locales/en-US/oauth.json

+7-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"accept": "Authorize",
55
"deny": "Deny"
66
},
7-
"description": "The application {clientId} is requesting access to your LobeChat account",
7+
"description": "The application {{clientName}} is requesting authorization for your account",
88
"error": {
99
"sessionInvalid": {
1010
"message": "The authorization session has expired or is invalid. Please restart the authorization process.",
@@ -16,16 +16,17 @@
1616
"title": "Unsupported Interaction Type"
1717
}
1818
},
19-
"permissionsTitle": "The application requests the following permissions:",
19+
"permissionsTitle": "Requesting the following permissions:",
20+
"redirectUri": "You will be redirected to after successful authorization",
2021
"scope": {
2122
"email": "Access your email address",
22-
"offline_access": "Continue to access your data while you are offline",
23+
"offline_access": "Allow the client to access your data",
2324
"openid": "Authenticate using your LobeChat account",
2425
"profile": "Access your basic profile information (name, avatar, etc.)",
25-
"sync:read": "Read your sync data",
26-
"sync:write": "Write and update your sync data"
26+
"sync-read": "Read your synchronized data",
27+
"sync-write": "Write and update your synchronized data"
2728
},
28-
"title": "Authorization Request"
29+
"title": "Authorize {{clientName}}"
2930
},
3031
"failed": {
3132
"backToHome": "Back to Home",

Diff for: locales/es-ES/oauth.json

+7-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"accept": "Autorizar",
55
"deny": "Denegar"
66
},
7-
"description": "La aplicación {clientId} solicita acceso a su cuenta de LobeChat",
7+
"description": "La aplicación {{clientName}} solicita autorización para su cuenta",
88
"error": {
99
"sessionInvalid": {
1010
"message": "La sesión de autorización ha expirado o es inválida, por favor inicie nuevamente el proceso de autorización.",
@@ -16,16 +16,17 @@
1616
"title": "Tipo de interacción no soportado"
1717
}
1818
},
19-
"permissionsTitle": "La aplicación solicita los siguientes permisos:",
19+
"permissionsTitle": "Solicitar los siguientes permisos:",
20+
"redirectUri": "Se redirigirá a después de la autorización exitosa",
2021
"scope": {
2122
"email": "Acceder a su dirección de correo electrónico",
22-
"offline_access": "Continuar accediendo a sus datos mientras está desconectado",
23+
"offline_access": "Permitir que el cliente acceda a sus datos",
2324
"openid": "Autenticarse con su cuenta de LobeChat",
2425
"profile": "Acceder a su información básica de perfil (nombre, foto, etc.)",
25-
"sync:read": "Leer sus datos de sincronización",
26-
"sync:write": "Escribir y actualizar sus datos de sincronización"
26+
"sync-read": "Leer sus datos sincronizados",
27+
"sync-write": "Escribir y actualizar sus datos sincronizados"
2728
},
28-
"title": "Solicitud de autorización"
29+
"title": "Autorizar {{clientName}}"
2930
},
3031
"failed": {
3132
"backToHome": "Volver a la página de inicio",

Diff for: locales/fa-IR/oauth.json

+7-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"accept": "اجازه",
55
"deny": "رد"
66
},
7-
"description": "برنامه {clientId} درخواست دسترسی به حساب LobeChat شما را دارد",
7+
"description": "برنامه {{clientName}} درخواست مجوز حساب شما را دارد",
88
"error": {
99
"sessionInvalid": {
1010
"message": "جلسه مجوز منقضی یا نامعتبر است، لطفاً فرآیند مجوز را دوباره آغاز کنید.",
@@ -16,16 +16,17 @@
1616
"title": "نوع تعامل پشتیبانی نمی‌شود"
1717
}
1818
},
19-
"permissionsTitle": "برنامه درخواست دسترسی به مجوزهای زیر را دارد:",
19+
"permissionsTitle": "درخواست مجوزهای زیر:",
20+
"redirectUri": "پس از موفقیت در مجوز، به آدرس زیر هدایت می‌شوید",
2021
"scope": {
2122
"email": "دسترسی به آدرس ایمیل شما",
22-
"offline_access": "دسترسی به داده‌های شما در حالت آفلاین",
23+
"offline_access": "اجازه دسترسی به داده‌های شما توسط کلاینت",
2324
"openid": "احراز هویت با حساب LobeChat شما",
2425
"profile": "دسترسی به اطلاعات پروفایل شما (نام، تصویر پروفایل و غیره)",
25-
"sync:read": "خواندن داده‌های همگام‌سازی شما",
26-
"sync:write": "نوشتن و به‌روزرسانی داده‌های همگام‌سازی شما"
26+
"sync-read": "خواندن داده‌های همگام‌سازی شده شما",
27+
"sync-write": "نوشتن و به‌روزرسانی داده‌های همگام‌سازی شده شما"
2728
},
28-
"title": "درخواست مجوز"
29+
"title": "مجوز {{clientName}}"
2930
},
3031
"failed": {
3132
"backToHome": "بازگشت به صفحه اصلی",

Diff for: locales/fr-FR/oauth.json

+7-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"accept": "Autoriser",
55
"deny": "Refuser"
66
},
7-
"description": "L'application {clientId} demande l'accès à votre compte LobeChat",
7+
"description": "L'application {{clientName}} demande l'autorisation de votre compte",
88
"error": {
99
"sessionInvalid": {
1010
"message": "La session d'autorisation a expiré ou est invalide, veuillez relancer le processus d'autorisation.",
@@ -16,16 +16,17 @@
1616
"title": "Type d'interaction non pris en charge"
1717
}
1818
},
19-
"permissionsTitle": "L'application demande les permissions suivantes :",
19+
"permissionsTitle": "Demander les autorisations suivantes :",
20+
"redirectUri": "Vous serez redirigé vers après une autorisation réussie",
2021
"scope": {
2122
"email": "Accéder à votre adresse e-mail",
22-
"offline_access": "Continuer à accéder à vos données lorsque vous êtes hors ligne",
23+
"offline_access": "Autoriser le client à accéder à vos données",
2324
"openid": "S'authentifier avec votre compte LobeChat",
2425
"profile": "Accéder à vos informations de profil (nom, photo, etc.)",
25-
"sync:read": "Lire vos données de synchronisation",
26-
"sync:write": "Écrire et mettre à jour vos données de synchronisation"
26+
"sync-read": "Lire vos données synchronisées",
27+
"sync-write": "Écrire et mettre à jour vos données synchronisées"
2728
},
28-
"title": "Demande d'autorisation"
29+
"title": "Autoriser {{clientName}}"
2930
},
3031
"failed": {
3132
"backToHome": "Retour à l'accueil",

Diff for: locales/it-IT/oauth.json

+7-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"accept": "Autorizza",
55
"deny": "Rifiuta"
66
},
7-
"description": "L'app {clientId} richiede accesso al tuo account LobeChat",
7+
"description": "L'applicazione {{clientName}} richiede l'autorizzazione per il tuo account",
88
"error": {
99
"sessionInvalid": {
1010
"message": "La sessione di autorizzazione è scaduta o non valida, per favore riavvia il processo di autorizzazione.",
@@ -16,16 +16,17 @@
1616
"title": "Tipo di interazione non supportato"
1717
}
1818
},
19-
"permissionsTitle": "L'app richiede i seguenti permessi:",
19+
"permissionsTitle": "Richiesta delle seguenti autorizzazioni:",
20+
"redirectUri": "Verrai reindirizzato a dopo un'autorizzazione riuscita",
2021
"scope": {
2122
"email": "Accesso al tuo indirizzo email",
22-
"offline_access": "Continua ad accedere ai tuoi dati quando sei offline",
23+
"offline_access": "Consenti all'accesso del client ai tuoi dati",
2324
"openid": "Autenticati con il tuo account LobeChat",
2425
"profile": "Accesso alle tue informazioni di base (nome, foto profilo, ecc.)",
25-
"sync:read": "Leggi i tuoi dati di sincronizzazione",
26-
"sync:write": "Scrivi e aggiorna i tuoi dati di sincronizzazione"
26+
"sync-read": "Leggi i tuoi dati sincronizzati",
27+
"sync-write": "Scrivi e aggiorna i tuoi dati sincronizzati"
2728
},
28-
"title": "Richiesta di autorizzazione"
29+
"title": "Autorizzazione per {{clientName}}"
2930
},
3031
"failed": {
3132
"backToHome": "Torna alla home",

Diff for: locales/ja-JP/oauth.json

+7-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"accept": "承認",
55
"deny": "拒否"
66
},
7-
"description": "{clientId} アプリがあなたの LobeChat アカウントへのアクセスを要求しています",
7+
"description": "アプリケーション {{clientName}} があなたのアカウントの承認を要求しています",
88
"error": {
99
"sessionInvalid": {
1010
"message": "承認セッションが期限切れまたは無効です。再度承認プロセスを開始してください。",
@@ -16,16 +16,17 @@
1616
"title": "サポートされていないインタラクションタイプ"
1717
}
1818
},
19-
"permissionsTitle": "アプリが以下の権限を要求しています:",
19+
"permissionsTitle": "以下の権限をリクエストします:",
20+
"redirectUri": "承認が成功した後、次の場所にリダイレクトされます",
2021
"scope": {
2122
"email": "あなたのメールアドレスにアクセス",
22-
"offline_access": "オフラインの際もデータにアクセス",
23+
"offline_access": "クライアントがあなたのデータにアクセスすることを許可",
2324
"openid": "あなたの LobeChat アカウントで認証",
2425
"profile": "基本的なプロフィール情報(名前、アバターなど)にアクセス",
25-
"sync:read": "あなたの同期データを読み取る",
26-
"sync:write": "あなたの同期データを書き込み、更新する"
26+
"sync-read": "あなたの同期データを読み取る",
27+
"sync-write": "あなたの同期データを書き込み、更新する"
2728
},
28-
"title": "承認リクエスト"
29+
"title": "{{clientName}} の承認"
2930
},
3031
"failed": {
3132
"backToHome": "ホームに戻る",

Diff for: locales/ko-KR/oauth.json

+7-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"accept": "허가",
55
"deny": "거부"
66
},
7-
"description": "{clientId} 애플리케이션이 귀하의 LobeChat 계정에 접근을 요청합니다",
7+
"description": "애플리케이션 {{clientName}}이(가) 귀하의 계정 권한을 요청합니다.",
88
"error": {
99
"sessionInvalid": {
1010
"message": "허가 세션이 만료되었거나 유효하지 않습니다. 허가 프로세스를 다시 시작하십시오.",
@@ -16,16 +16,17 @@
1616
"title": "지원되지 않는 상호작용 유형"
1717
}
1818
},
19-
"permissionsTitle": "애플리케이션이 다음 권한을 요청합니다:",
19+
"permissionsTitle": "다음 권한 요청:",
20+
"redirectUri": "권한 부여가 성공적으로 완료된 후 리디렉션됩니다.",
2021
"scope": {
2122
"email": "귀하의 이메일 주소에 접근",
22-
"offline_access": "오프라인 상태에서도 귀하의 데이터에 접근",
23+
"offline_access": "클라이언트가 귀하의 데이터에 접근할 수 있도록 허용",
2324
"openid": "귀하의 LobeChat 계정으로 인증",
2425
"profile": "귀하의 기본 프로필 정보(이름, 프로필 사진 등)에 접근",
25-
"sync:read": "귀하의 동기화 데이터 읽기",
26-
"sync:write": "귀하의 동기화 데이터 쓰기 및 업데이트"
26+
"sync-read": "귀하의 동기화 데이터를 읽습니다",
27+
"sync-write": "귀하의 동기화 데이터를 작성하고 업데이트합니다"
2728
},
28-
"title": "허가 요청"
29+
"title": "권한 부여 {{clientName}}"
2930
},
3031
"failed": {
3132
"backToHome": "홈으로 돌아가기",

Diff for: locales/nl-NL/oauth.json

+7-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"accept": "Toestaan",
55
"deny": "Weigeren"
66
},
7-
"description": "De applicatie {clientId} vraagt toegang tot uw LobeChat-account",
7+
"description": "De applicatie {{clientName}} vraagt om toestemming voor uw account",
88
"error": {
99
"sessionInvalid": {
1010
"message": "De autorisatiesessie is verlopen of ongeldig, start het autorisatieproces opnieuw.",
@@ -16,16 +16,17 @@
1616
"title": "Niet-ondersteund interactietype"
1717
}
1818
},
19-
"permissionsTitle": "De applicatie vraagt om de volgende machtigingen:",
19+
"permissionsTitle": "Vraag om de volgende toestemmingen:",
20+
"redirectUri": "U wordt omgeleid naar na succesvolle autorisatie",
2021
"scope": {
2122
"email": "Toegang tot uw e-mailadres",
22-
"offline_access": "Toegang tot uw gegevens wanneer u offline bent",
23+
"offline_access": "Toestaan dat de client toegang heeft tot uw gegevens",
2324
"openid": "Authenticatie met uw LobeChat-account",
2425
"profile": "Toegang tot uw basisprofielinformatie (naam, profielfoto, enz.)",
25-
"sync:read": "Lezen van uw synchronisatiegegevens",
26-
"sync:write": "Schrijven en bijwerken van uw synchronisatiegegevens"
26+
"sync-read": "Lees uw gesynchroniseerde gegevens",
27+
"sync-write": "Schrijf en werk uw gesynchroniseerde gegevens bij"
2728
},
28-
"title": "Autorisatieverzoek"
29+
"title": "Toestemming voor {{clientName}}"
2930
},
3031
"failed": {
3132
"backToHome": "Terug naar de startpagina",

Diff for: locales/pl-PL/oauth.json

+7-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"accept": "Zgoda",
55
"deny": "Odmowa"
66
},
7-
"description": "Aplikacja {clientId} prosi o dostęp do Twojego konta LobeChat",
7+
"description": "Aplikacja {{clientName}} prosi o autoryzację Twojego konta",
88
"error": {
99
"sessionInvalid": {
1010
"message": "Sesja autoryzacyjna wygasła lub jest nieprawidłowa, proszę ponownie rozpocząć proces autoryzacji.",
@@ -16,16 +16,17 @@
1616
"title": "Nieobsługiwany typ interakcji"
1717
}
1818
},
19-
"permissionsTitle": "Aplikacja prosi o następujące uprawnienia:",
19+
"permissionsTitle": "Proszę o następujące uprawnienia:",
20+
"redirectUri": "Zostaniesz przekierowany po pomyślnym autoryzowaniu",
2021
"scope": {
2122
"email": "Dostęp do Twojego adresu e-mail",
22-
"offline_access": "Dostęp do Twoich danych, gdy jesteś offline",
23+
"offline_access": "Zezwól klientowi na dostęp do Twoich danych",
2324
"openid": "Uwierzytelnienie za pomocą Twojego konta LobeChat",
2425
"profile": "Dostęp do Twoich podstawowych informacji (imię, zdjęcie profilowe itp.)",
25-
"sync:read": "Odczyt Twoich danych synchronizacji",
26-
"sync:write": "Zapis i aktualizacja Twoich danych synchronizacji"
26+
"sync-read": "Odczytaj swoje dane synchronizacyjne",
27+
"sync-write": "Zapisz i zaktualizuj swoje dane synchronizacyjne"
2728
},
28-
"title": "Prośba o autoryzację"
29+
"title": "Autoryzacja {{clientName}}"
2930
},
3031
"failed": {
3132
"backToHome": "Powrót do strony głównej",

0 commit comments

Comments
 (0)