diff --git a/docs/Deployment/Authentication.md b/docs/Deployment/Authentication.md new file mode 100644 index 0000000000000..0fd40bb06dca7 --- /dev/null +++ b/docs/Deployment/Authentication.md @@ -0,0 +1,72 @@ +# Authentication Service + +LobeChat supports configuring external identity verification services for internal use within enterprises/organizations, facilitating centralized management of user authorizations. Currently, [Auth0][auth0-client-page] is supported. This article will guide you through the process of setting up the identity verification service. + +### TOC + +- [Creating an Auth0 Application](#creating-an-auth0-application) +- [Adding Users](#adding-users) +- [Configuring Environment Variables](#configuring-environment-variables) +- [Advanced - Connecting to an Existing Single Sign-On Service](#advanced---connecting-to-an-existing-single-sign-on-service) +- [Advanced - Configuring Social Login](#advanced---configuring-social-login) + +## Creating an Auth0 Application + +To begin, register and log in to [Auth0][auth0-client-page]. Then, navigate to the **_Applications_** section in the left sidebar to access the application management interface. Click on **_Create Application_** in the top right corner to initiate the application creation process. + +![](https://github.com/CloudPassenger/lobe-chat/assets/30863298/1b405347-f4c3-4c55-82f6-47116f2210d0) + +Next, fill in the desired application name to be displayed to organization users. You can choose any application type, then click on **_Create_**. + +![](https://github.com/CloudPassenger/lobe-chat/assets/30863298/75c92f85-3ad3-4473-a9c6-e667e28d428d) + +Once the application is successfully created, click on the respective application to access its details page. Switch to the **_Settings_** tab to view the corresponding configuration information. + +![](https://github.com/CloudPassenger/lobe-chat/assets/30863298/a1ed996b-95ef-4b7d-a50d-b4666eccfecb) + +## Adding Users + +Navigate to the **_Users Management_** section in the left sidebar to access the user management interface. You can create new users for your organization to log in to LobeChat. + +![](https://github.com/CloudPassenger/lobe-chat/assets/30863298/3b8127ab-dc4f-4ff9-a4cb-dec3ef0295cc) + +## Configuring Environment Variables + +When deploying LobeChat, you need to configure the following environment variables: + +| Environment Variable | Required | Description | Default Value | Example | +| --------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------- | ------------- | ------------------------------------------------------------------ | +| `ENABLE_OAUTH_SSO` | Yes | Enable single sign-on (SSO) for LobeChat. Set this value to `1` to enable single sign-on. | - | `1` | +| `NEXTAUTH_SECRET` | Yes | The key used to encrypt the session token in Auth.js. You can generate a key using the following command: `openssl rand -base64 32` | - | `Tfhi2t2pelSMEA8eaV61KaqPNEndFFdMIxDaJnS1CUI=` | +| `AUTH0_CLIENT_ID` | Yes | Client ID of the Auth0 application | - | `evCnOJP1UX8FMnXR9Xkj5t0NyFn5p70P` | +| `AUTH0_CLIENT_SECRET` | Yes | Client Secret of the Auth0 application | - | `wnX7UbZg85ZUzF6ioxPLnJVEQa1Elbs7aqBUSF16xleBS5AdkVfASS49-fQIC8Rm` | +| `AUTH0_ISSUER` | Yes | Domain of the Auth0 application | - | `https://example.auth0.com` | +| `ACCESS_CODE` | Yes | Add a password to access this service. You can set a long random password to "disable" accessed by the code | - | `awCT74` or `e3@09!` or `code1,code2,code3` | + +> \[!NOTE] +> +> After successful deployment, users will be able to authenticate and use LobeChat using the users configured in Auth0. + +## Advanced - Connecting to an Existing Single Sign-On Service + +If your enterprise or organization already has an existing unified identity verification infrastructure, you can connect to an existing single sign-on service in **_Applications -> SSO Integrations_**. + +Auth0 supports single sign-on services such as Azure Active Directory, Slack, Google Workspace, Office 365, and Zoom. For a detailed list of supported services, refer to [this page][auth0-sso-integrations]. + +![](https://github.com/CloudPassenger/lobe-chat/assets/30863298/32650f4f-d0b0-4843-b26d-d35bad11d8a3) + +## Advanced - Configuring Social Login + +If your enterprise or organization needs to support external personnel login, you can configure social login services in **_Authentication -> Social_**. + +![](https://github.com/CloudPassenger/lobe-chat/assets/30863298/7b6f6a6c-2686-49d8-9dbd-0516053f1efa) + +> \[!NOTE] +> +> Configuring social login services will allow anyone to authenticate by default, which may lead to abuse of LobeChat by external personnel. If you need to restrict login personnel, be sure to configure a blocking policy. +> +> After enabling social login options, refer to [this article][auth0-login-actions-manual] to create an Action to set the deny/allow list. + +[auth0-client-page]: https://manage.auth0.com/dashboard +[auth0-login-actions-manual]: https://auth0.com/blog/permit-or-deny-login-requests-using-auth0-actions/ +[auth0-sso-integrations]: https://marketplace.auth0.com/features/sso-integrations diff --git a/docs/Deployment/Authentication.zh-CN.md b/docs/Deployment/Authentication.zh-CN.md new file mode 100644 index 0000000000000..dde5e64e48c02 --- /dev/null +++ b/docs/Deployment/Authentication.zh-CN.md @@ -0,0 +1,72 @@ +# 身份验证服务 + +LobeChat 支持配置外部身份验证服务,供企业 / 组织内部使用,统一管理用户授权,目前支持 [Auth0][auth0-client-page] 本文将介绍如何配置身份验证服务。 + +### TOC + +- [创建 Auth0 应用](#创建-auth0-应用) +- [新增用户](#新增用户) +- [配置环境变量](#配置环境变量) +- [进阶 - 连接现有的单点登录服务](#进阶---连接现有的单点登录服务) +- [进阶 - 配置社交登录](#进阶---配置社交登录) + +## 创建 Auth0 应用 + +注册并登录 [Auth0][auth0-client-page],点击左侧导航栏的「Applications」,切换到应用管理界面,点击右上角「Create Application」以创建应用。 + +![](https://github.com/CloudPassenger/lobe-chat/assets/30863298/1b405347-f4c3-4c55-82f6-47116f2210d0) + +填写你想向组织用户显示的应用名称,可选择任意应用类型,点击「Create」。 + +![](https://github.com/CloudPassenger/lobe-chat/assets/30863298/75c92f85-3ad3-4473-a9c6-e667e28d428d) + +创建成功后,点击相应的应用,进入应用详情页,切换到「Settings」标签页,就可以看到相应的配置信息 + +![](https://github.com/CloudPassenger/lobe-chat/assets/30863298/a1ed996b-95ef-4b7d-a50d-b4666eccfecb) + +## 新增用户 + +点击左侧导航栏的「Users Management」,进入用户管理界面,可以为你的组织新建用户,用以登录 LobeChat + +![](https://github.com/CloudPassenger/lobe-chat/assets/30863298/3b8127ab-dc4f-4ff9-a4cb-dec3ef0295cc) + +## 配置环境变量 + +在部署 LobeChat 时,你需要配置以下环境变量: + +| 环境变量 | 类型 | 描述 | 默认值 | 示例 | +| --------------------- | ---- | --------------------------------------------------------------------------------------- | ------ | ------------------------------------------------------------------ | +| `ENABLE_OAUTH_SSO` | 必选 | 为 LobeChat 启用单点登录 (SSO)。设置为 `1` 以启用单点登录。 | - | `1` | +| `NEXTAUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` | - | `Tfhi2t2pelSMEA8eaV61KaqPNEndFFdMIxDaJnS1CUI=` | +| `AUTH0_CLIENT_ID` | 必选 | Auth0 应用程序的 Client ID | - | `evCnOJP1UX8FMnXR9Xkj5t0NyFn5p70P` | +| `AUTH0_CLIENT_SECRET` | 必选 | Auth0 应用程序的 Client Secret | - | `wnX7UbZg85ZUzF6ioxPLnJVEQa1Elbs7aqBUSF16xleBS5AdkVfASS49-fQIC8Rm` | +| `AUTH0_ISSUER` | 必选 | Auth0 应用程序的 Domain | - | `https://example.auth0.com` | +| `ACCESS_CODE` | 必选 | 添加访问此服务的密码,你可以设置一个足够长的随机密码以 “禁用” 访问码授权 | - | `awCT74` 或 `e3@09!` or `code1,code2,code3` | + +> \[!NOTE] +> +> 部署成功后,用户将可以使用 Auth0 中配置的用户通过身份认证并使用 LobeChat。 + +## 进阶 - 连接现有的单点登录服务 + +如果你的企业或组织已有现有的统一身份认证设施,可在 Applications -> SSO Integrations 中,连接现有的单点登录服务。 + +Auth0 支持 Azure Active Directory, Slack, Google Workspace, Office 365, Zoom 等单点登录服务,详细支持列表可参考 [这里][auth0-sso-integrations] + +![](https://github.com/CloudPassenger/lobe-chat/assets/30863298/32650f4f-d0b0-4843-b26d-d35bad11d8a3) + +## 进阶 - 配置社交登录 + +如果你的企业或组织需要支持外部人员登录,可以在 Authentication -> Social 中,配置社交登录服务。 + +![](https://github.com/CloudPassenger/lobe-chat/assets/30863298/7b6f6a6c-2686-49d8-9dbd-0516053f1efa) + +> \[!NOTE] +> +> 配置社交登录服务默认会允许所有人通过认证,这可能会导致 LobeChat 被外部人员滥用。如果你需要限制登录人员,务必配置阻止策略 +> +> 请在打开社交登录选项后,参考 [这篇文章][auth0-login-actions-manual] 创建 Action 来设置阻止 / 允许 列表 + +[auth0-client-page]: https://manage.auth0.com/dashboard +[auth0-login-actions-manual]: https://auth0.com/blog/permit-or-deny-login-requests-using-auth0-actions/ +[auth0-sso-integrations]: https://marketplace.auth0.com/features/sso-integrations diff --git a/docs/Deployment/Environment-Variable.md b/docs/Deployment/Environment-Variable.md index 658888bfcddbc..5346efb1a12b0 100644 --- a/docs/Deployment/Environment-Variable.md +++ b/docs/Deployment/Environment-Variable.md @@ -6,6 +6,10 @@ LobeChat provides additional configuration options during deployment, which can - [General Variables](#general-variables) - [`ACCESS_CODE`](#access_code) + - [`ENABLE_OAUTH_SSO`](#enable_oauth_sso) +- [Authentication Service Providers](#authentication-service-providers) + - [Common Settings](#common-settings) + - [Auth0](#auth0) - [Model Service Providers](#model-service-providers) - [OpenAI](#openai) - [Azure OpenAI](#azure-openai) @@ -31,6 +35,51 @@ LobeChat provides additional configuration options during deployment, which can - Default: `-` - Example: `awCTe)re_r74` or `rtrt_ewee3@09!` or `code1,code2,code3` +### `ENABLE_OAUTH_SSO` + +- Type: Optional +- Description: Enable OAuth single sign-on (SSO) for LobeChat. Set to `1` to enable OAuth SSO. See [Authentication Service Providers](#authentication-service-providers) for more details. +- Default: `-` +- Example: `1` or `0` + +## Authentication Service Providers + +### Common Settings + +#### `NEXTAUTH_SECRET` + +- Type: Required +- Description: The secret key used to encrypt the Auth.js session token. You can generate a secret key using the following command: `openssl rand -base64 32` +- Default: `-` +- Example: `Tfhi2t2pelSMEA8eaV61KaqPNEndFFdMIxDaJnS1CUI=` + +### Auth0 + +> !\[NOTE] +> +> We only support the Auth0 authentication service provider at the moment. If you need to use other authentication service providers, you can submit a feature request or pull request. + +#### `AUTH0_CLIENT_ID` + +- Type: Required +- Description: The Client ID of the Auth0 application, you can go [here][auth0-client-page] and navigate to the application settings to view +- Default: `-` +- Example: `evCnOJP1UX8FMnXR9Xkj5t0NyFn5p70P` + +#### `AUTH0_CLIENT_SECRET` + +- Type: Required +- Description: The Client Secret of the Auth0 application +- Default: `-` +- Example: `wnX7UbZg85ZUzF6ioxPLnJVEQa1Elbs7aqBUSF16xleBS5AdkVfASS49-fQIC8Rm` + +#### `AUTH0_ISSUER` + +- Type: Required +- Description: The issuer/domain of the Auth0 application +- Default: `-` +- Example: `https://example.auth0.com` + ## Model Service Providers ### OpenAI @@ -237,6 +286,7 @@ The above example adds `search-engine` plugin settings, and sets the `SERPAPI_AP - Default: - - Example: `1` +[auth0-client-page]: https://manage.auth0.com/dashboard [azure-api-verion-url]: https://docs.microsoft.com/zh-cn/azure/developer/javascript/api-reference/es-modules/azure-sdk/ai-translation/translationconfiguration?view=azure-node-latest#api-version [openai-api-page]: https://platform.openai.com/account/api-keys [posthog-analytics-url]: https://posthog.com diff --git a/docs/Deployment/Environment-Variable.zh-CN.md b/docs/Deployment/Environment-Variable.zh-CN.md index c36212c681ad9..4a0a9a14ab871 100644 --- a/docs/Deployment/Environment-Variable.zh-CN.md +++ b/docs/Deployment/Environment-Variable.zh-CN.md @@ -6,6 +6,10 @@ LobeChat 在部署时提供了一些额外的配置项,使用环境变量进 - [通用变量](#通用变量) - [`ACCESS_CODE`](#access_code) + - [`ENABLE_OAUTH_SSO`](#enable_oauth_sso) +- [身份验证服务](#身份验证服务) + - [通用设置](#通用设置) + - [Auth0](#auth0) - [模型服务商](#模型服务商) - [OpenAI](#openai) - [Azure OpenAI](#azure-openai) @@ -31,6 +35,51 @@ LobeChat 在部署时提供了一些额外的配置项,使用环境变量进 - 默认值:- - 示例:`awCTe)re_r74` or `rtrt_ewee3@09!` +### `ENABLE_OAUTH_SSO` + +- 类型:可选 +- 描述:为 LobeChat 启用单点登录 (SSO)。设置为 `1` 以启用单点登录。有关详细信息,请参阅[身份验证服务](#身份验证服务)。 +- 默认值: `-` +- 示例: `1` 或 `0` + +## 身份验证服务 + +### 通用设置 + +#### `NEXTAUTH_SECRET` + +- 类型:必须 +- 描述:用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32`. +- 默认值: `-` +- 示例: `Tfhi2t2pelSMEA8eaV61KaqPNEndFFdMIxDaJnS1CUI=` + +### Auth0 + +> !\[NOTE] 注意事项: +> +> 目前我们只支持 Auth0 身份验证服务提供商。如果您需要使用其他身份验证服务提供商,可以提交功能请求或 Pull Request。 + +#### `AUTH0_CLIENT_ID` + +- 类型:必须 +- 描述: Auth0 应用程序的 Client ID,您可以访问[这里][auth0-client-page]并导航至应用程序设置来查看 +- 默认值: `-` +- 示例: `evCnOJP1UX8FMnXR9Xkj5t0NyFn5p70P` + +#### `AUTH0_CLIENT_SECRET` + +- 类型:必须 +- 描述: Auth0 应用程序的 Client Secret +- 默认值: `-` +- 示例: `wnX7UbZg85ZUzF6ioxPLnJVEQa1Elbs7aqBUSF16xleBS5AdkVfASS49-fQIC8Rm` + +#### `AUTH0_ISSUER` + +- 类型:必须 +- 描述: Auth0 应用程序的签发人 / 域 +- 默认值: `-` +- 示例: `https://example.auth0.com` + ## 模型服务商 ### OpenAI @@ -233,6 +282,7 @@ LobeChat 在部署时提供了一些额外的配置项,使用环境变量进 - 默认值: `-` - 示例:`1` +[auth0-client-page]: https://manage.auth0.com/dashboard [azure-api-verion-url]: https://docs.microsoft.com/zh-cn/azure/developer/javascript/api-reference/es-modules/azure-sdk/ai-translation/translationconfiguration?view=azure-node-latest#api-version [openai-api-page]: https://platform.openai.com/account/api-keys [posthog-analytics-url]: https://posthog.com diff --git a/docs/Development/Authentication.md b/docs/Development/Authentication.md new file mode 100644 index 0000000000000..d7da231e84991 --- /dev/null +++ b/docs/Development/Authentication.md @@ -0,0 +1,85 @@ +# New Authentication Provider Guide + +LobeChat uses [Auth.js v5](https://authjs.dev/) as the external authentication service. Auth.js is an open-source authentication library that provides a simple way to implement authentication and authorization features. This document will introduce how to use Auth.js to implement a new authentication provider. + +### TOC + +- [Add New Authentication Provider](#add-new-authentication-provider) + - [Pre-requisites: Check the Official Provider List](#pre-requisites-check-the-official-provider-list) + - [Step 1: Add Authenticator Core Code](#step-1-add-authenticator-core-code) + - [Step 2: Update Server Configuration Code](#step-2-update-server-configuration-code) + - [Step 3: Change Frontend Pages](#step-3-change-frontend-pages) + - [Step 4: Configure the Environment Variables](#step-4-configure-the-environment-variables) + +## Add New Authentication Provider + +To add a new authentication provider in LobeChat (for example, adding Okta), you need to follow the steps below: + +### Pre-requisites: Check the Official Provider List + +First, you need to check the [Auth.js Provider List](https://authjs.dev/reference/core/providers) to see if your provider is already supported. If yes, you can directly use the SDK provided by Auth.js to implement the authentication feature. + +Next, I will use [Okta](https://authjs.dev/reference/core/providers/okta) as an example to introduce how to add a new authentication provider. + +### Step 1: Add Authenticator Core Code + +Open the `src/app/api/oauth/next-auth.ts` file and import `next-auth/providers/okta`. + +```ts +import { NextAuth } from 'next-auth'; +import Auth0 from 'next-auth/providers/auth0'; +import Okta from 'next-auth/providers/okta'; + +// Import Okta provider +``` + +Add the predefined server configuration. + +```ts +// Import server configuration +const { OKTA_CLIENT_ID, OKTA_CLIENT_SECRET, OKTA_ISSUER } = getServerConfig(); + +const nextAuth = NextAuth({ + providers: [ + // ... Other providers + + Okta({ + clientId: OKTA_CLIENT_ID, + clientSecret: OKTA_CLIENT_SECRET, + issuer: OKTA_ISSUER, + }), + ], +}); +``` + +### Step 2: Update Server Configuration Code + +Open the `src/config/server/app.ts` file and add Okta-related environment variables in the `getAppConfig` function. + +```ts +export const getAppConfig = () => { + // ... Other code + + return { + // ... Other environment variables + + OKTA_CLIENT_ID: process.env.OKTA_CLIENT_ID || '', + OKTA_CLIENT_SECRET: process.env.OKTA_CLIENT_SECRET || '', + OKTA_ISSUER: process.env.OKTA_ISSUER || '', + }; +}; +``` + +### Step 3: Change Frontend Pages + +Modify the `signIn` function parameter in `src/Features/Conversation/Error/OAuthForm.tsx` and \`src/app/settings/common/Common.tsx + +The default is `auth0`, which you can change to `okta` to switch to the Okta provider, or remove this parameter to support all added authentication services + +This value is the id of the Auth.js provider, and you can read the source code of the corresponding `next-auth/providers` module to read the default ID. + +### Step 4: Configure the Environment Variables + +Add `OKTA_CLIENT_ID`、`OKTA_CLIENT_SECRET`、`OKTA_ISSUER` environment variables when you deploy. + +Now, you can use Okta as your provider to implement the authentication feature in LobeChat. diff --git a/docs/Development/Authentication.zh-CN.md b/docs/Development/Authentication.zh-CN.md new file mode 100644 index 0000000000000..204669ce0342c --- /dev/null +++ b/docs/Development/Authentication.zh-CN.md @@ -0,0 +1,83 @@ +# 新身份验证方式开发指南 + +LobeChat 使用 [Auth.js v5](https://authjs.dev/) 作为外部身份验证服务。Auth.js 是一个开源的身份验证库,它提供了一种简单的方式来实现身份验证和授权功能。本文档将介绍如何使用 Auth.js 来实现新的身份验证方式。 + +### TOC + +- [添加新的身份验证提供者](#添加新的身份验证提供者) + - [准备工作:查阅官方的提供者列表](#准备工作查阅官方的提供者列表) + - [步骤 1: 新增关键代码](#步骤-1-新增关键代码) + - [步骤 2: 更新服务端配置代码](#步骤-2-更新服务端配置代码) + - [步骤 3: 修改前端页面](#步骤-3-修改前端页面) + - [步骤 4: 配置环境变量](#步骤-4-配置环境变量) + +## 添加新的身份验证提供者 + +为了在 LobeChat 中添加新的身份验证提供者(例如添加 Okta),你需要完成以下步骤: + +### 准备工作:查阅官方的提供者列表 + +首先,你需要查阅 [Auth.js 提供者列表](https://authjs.dev/reference/core/providers) 来了解是否你的提供者已经被支持。如果你的提供者已经被支持,你可以直接使用 Auth.js 提供的 SDK 来实现身份验证功能。 + +接下来我会以 [Okta](https://authjs.dev/reference/core/providers/okta) 为例来介绍如何添加新的身份验证提供者 + +### 步骤 1: 新增关键代码 + +打开 `src/app/api/oauth/next-auth.ts` 文件,引入 `next-auth/providers/okta` + +```ts +import { NextAuth } from 'next-auth'; +import Auth0 from 'next-auth/providers/auth0'; +import Okta from 'next-auth/providers/okta'; + +// 引入 Okta 提供者 +``` + +新增预定义的服务端配置 + +```ts +// 导入服务器配置 +const { OKTA_CLIENT_ID, OKTA_CLIENT_SECRET, OKTA_ISSUER } = getServerConfig(); + +const nextAuth = NextAuth({ + providers: [ + // ... 其他提供者 + + Okta({ + clientId: OKTA_CLIENT_ID, + clientSecret: OKTA_CLIENT_SECRET, + issuer: OKTA_ISSUER, + }), + ], +}); +``` + +### 步骤 2: 更新服务端配置代码 + +打开 `src/config/server/app.ts` 文件,在 `getAppConfig` 函数中新增 Okta 相关的环境变量 + +```ts +export const getAppConfig = () => { + // ... 其他代码 + + return { + // ... 其他环境变量 + + OKTA_CLIENT_ID: process.env.OKTA_CLIENT_ID || '', + OKTA_CLIENT_SECRET: process.env.OKTA_CLIENT_SECRET || '', + OKTA_ISSUER: process.env.OKTA_ISSUER || '', + }; +}; +``` + +### 步骤 3: 修改前端页面 + +修改在 `src/features/Conversation/Error/OAuthForm.tsx` 及 `src/app/settings/common/Common.tsx` 中的 `signIn` 函数参数 + +默认为 `auth0`,你可以将其修改为 `okta` 以切换到 Okta 提供者,或删除该参数以支持所有已添加的身份验证服务 + +该值为 Auth.js 提供者 的 id,你可以阅读相应的 `next-auth/providers` 模块源码以读取默认 ID + +### 步骤 4: 配置环境变量 + +在部署时新增 Okta 相关的环境变量 `OKTA_CLIENT_ID`、`OKTA_CLIENT_SECRET`、`OKTA_ISSUER`,并填入相应的值,即可使用 diff --git a/locales/ar/common.json b/locales/ar/common.json index 6a2ef1f2c842f..faa4f1f887ae2 100644 --- a/locales/ar/common.json +++ b/locales/ar/common.json @@ -108,6 +108,7 @@ "zhipu": "زهيبو" }, "noDescription": "لا توجد وصف", + "oauth": "تسجيل الدخول SSO", "ok": "موافق", "password": "كلمة المرور", "pin": "تثبيت في الأعلى", diff --git a/locales/ar/error.json b/locales/ar/error.json index ff4b2ae6595a8..938e44b470833 100644 --- a/locales/ar/error.json +++ b/locales/ar/error.json @@ -94,6 +94,12 @@ }, "closeMessage": "إغلاق الرسالة", "confirm": "تأكيد وإعادة المحاولة", + "oauth": { + "description": "فتح المسؤول توثيق تسجيل الدخول الموحد، انقر فوق الزر أدناه لتسجيل الدخول وفتح التطبيق", + "success": "تم تسجيل الدخول بنجاح", + "title": "تسجيل الدخول إلى الحساب", + "welcome": "مرحبا بك!" + }, "password": { "description": "قام المسؤول بتشفير التطبيق، قم بإدخال كلمة مرور التطبيق لفتح التطبيق. يتعين إدخال كلمة المرور مرة واحدة فقط", "placeholder": "الرجاء إدخال كلمة المرور", diff --git a/locales/ar/setting.json b/locales/ar/setting.json index 4f49034e64d7a..1a939d9d9f9e8 100644 --- a/locales/ar/setting.json +++ b/locales/ar/setting.json @@ -263,6 +263,22 @@ "placeholder": "الرجاء إدخال كلمة المرور", "title": "كلمة المرور" }, + "oauth": { + "info": { + "desc": "تم تسجيل الدخول", + "title": "معلومات الحساب" + }, + "signin": { + "action": "تسجيل الدخول", + "desc": "قم بتسجيل الدخول باستخدام SSO لفتح التطبيق", + "title": "تسجيل الدخول إلى الحساب" + }, + "signout": { + "action": "تسجيل الخروج", + "confirm": "هل ترغب في تأكيد الخروج؟", + "success": "تم تسجيل الخروج بنجاح" + } + }, "title": "إعدادات النظام" }, "settingTTS": { diff --git a/locales/de-DE/common.json b/locales/de-DE/common.json index 13f66a06f6d57..c8086637f2967 100644 --- a/locales/de-DE/common.json +++ b/locales/de-DE/common.json @@ -108,6 +108,7 @@ "zhipu": "Zhipu AI" }, "noDescription": "Keine Beschreibung vorhanden", + "oauth": "SSO-Anmeldung", "ok": "OK", "password": "Passwort", "pin": "Anheften", diff --git a/locales/de-DE/error.json b/locales/de-DE/error.json index 614e9f474a04e..e3c49c7dcd00f 100644 --- a/locales/de-DE/error.json +++ b/locales/de-DE/error.json @@ -94,6 +94,12 @@ }, "closeMessage": "Hinweis schließen", "confirm": "Bestätigen und erneut versuchen", + "oauth": { + "description": "Der Administrator hat die einheitliche Anmeldeauthentifizierung aktiviert. Klicken Sie unten auf die Schaltfläche, um sich anzumelden und die App zu entsperren.", + "success": "Anmeldung erfolgreich", + "title": "Anmelden", + "welcome": "Willkommen!" + }, "password": { "description": "Der Administrator hat die App-Verschlüsselung aktiviert. Gib das App-Passwort ein, um die App zu entsperren. Das Passwort muss nur einmal eingegeben werden.", "placeholder": "Passwort eingeben", diff --git a/locales/de-DE/setting.json b/locales/de-DE/setting.json index 510c9822c3512..784489fb352a7 100644 --- a/locales/de-DE/setting.json +++ b/locales/de-DE/setting.json @@ -263,6 +263,22 @@ "placeholder": "Bitte geben Sie das Zugangspasswort ein", "title": "Zugangspasswort" }, + "oauth": { + "info": { + "desc": "Angemeldet", + "title": "Kontoinformationen" + }, + "signin": { + "action": "Anmelden", + "desc": "Mit SSO anmelden, um die Anwendung freizuschalten", + "title": "Konto anmelden" + }, + "signout": { + "action": "Abmelden", + "confirm": "Abmelden bestätigen?", + "success": "Abmeldung erfolgreich" + } + }, "title": "Systemeinstellungen" }, "settingTTS": { diff --git a/locales/en-US/common.json b/locales/en-US/common.json index 8a822840b3811..7342ccd8b659d 100644 --- a/locales/en-US/common.json +++ b/locales/en-US/common.json @@ -108,6 +108,7 @@ "zhipu": "Zhipu AI" }, "noDescription": "No description available", + "oauth": "SSO Login", "ok": "OK", "password": "Password", "pin": "Pin", diff --git a/locales/en-US/error.json b/locales/en-US/error.json index 209b1b8ab2162..f57cda59b35a6 100644 --- a/locales/en-US/error.json +++ b/locales/en-US/error.json @@ -94,6 +94,12 @@ }, "closeMessage": "Close message", "confirm": "Confirm and Retry", + "oauth": { + "description": "The administrator has enabled unified login authentication. Click the button below to log in and unlock the application.", + "success": "Login successful", + "title": "Log in to your account", + "welcome": "Welcome!" + }, "password": { "description": "The application encryption has been enabled by the administrator. Enter the application password to unlock the application. The password only needs to be filled in once.", "placeholder": "Please enter password", diff --git a/locales/en-US/setting.json b/locales/en-US/setting.json index f23bfdd8c2c81..06de1f86d5adf 100644 --- a/locales/en-US/setting.json +++ b/locales/en-US/setting.json @@ -263,6 +263,22 @@ "placeholder": "Enter access password", "title": "Access Password" }, + "oauth": { + "info": { + "desc": "Logged in", + "title": "Account Information" + }, + "signin": { + "action": "Sign In", + "desc": "Sign in using SSO to unlock the app", + "title": "Sign In to Your Account" + }, + "signout": { + "action": "Sign Out", + "confirm": "Confirm sign out?", + "success": "Sign out successful" + } + }, "title": "System Settings" }, "settingTTS": { diff --git a/locales/es-ES/common.json b/locales/es-ES/common.json index 697f6af8aaf6f..3ed54275d236b 100644 --- a/locales/es-ES/common.json +++ b/locales/es-ES/common.json @@ -108,6 +108,7 @@ "zhipu": "Zhipu AI" }, "noDescription": "Sin descripción", + "oauth": "Inicio de sesión SSO", "ok": "Aceptar", "password": "Contraseña", "pin": "Fijar", diff --git a/locales/es-ES/error.json b/locales/es-ES/error.json index fe60dcdbfed19..219a537378ca7 100644 --- a/locales/es-ES/error.json +++ b/locales/es-ES/error.json @@ -94,6 +94,12 @@ }, "closeMessage": "Cerrar mensaje", "confirm": "Confirmar y volver a intentar", + "oauth": { + "description": "El administrador ha habilitado la autenticación de inicio de sesión única. Haz clic en el botón a continuación para iniciar sesión y desbloquear la aplicación.", + "success": "Inicio de sesión exitoso", + "title": "Iniciar sesión", + "welcome": "¡Bienvenido!" + }, "password": { "description": "El administrador ha activado el cifrado de la aplicación. Ingresa la contraseña de la aplicación para desbloquearla. La contraseña solo se necesita ingresar una vez", "placeholder": "Ingresa la contraseña", diff --git a/locales/es-ES/setting.json b/locales/es-ES/setting.json index 314f443b6636e..d92b268fac894 100644 --- a/locales/es-ES/setting.json +++ b/locales/es-ES/setting.json @@ -263,6 +263,22 @@ "placeholder": "Ingrese la contraseña de acceso", "title": "Contraseña de acceso" }, + "oauth": { + "info": { + "desc": "Sesión iniciada", + "title": "Información de la cuenta" + }, + "signin": { + "action": "Iniciar sesión", + "desc": "Inicia sesión con SSO para desbloquear la aplicación", + "title": "Iniciar sesión en la cuenta" + }, + "signout": { + "action": "Cerrar sesión", + "confirm": "¿Confirmar cierre de sesión?", + "success": "Sesión cerrada con éxito" + } + }, "title": "Configuración del sistema" }, "settingTTS": { diff --git a/locales/fr-FR/common.json b/locales/fr-FR/common.json index 3f2b6dc49b06a..c832dd6b7fa23 100644 --- a/locales/fr-FR/common.json +++ b/locales/fr-FR/common.json @@ -108,6 +108,7 @@ "zhipu": "Zhipu AI" }, "noDescription": "Aucune description disponible", + "oauth": "Connexion SSO", "ok": "OK", "password": "Mot de passe", "pin": "Épingler", diff --git a/locales/fr-FR/error.json b/locales/fr-FR/error.json index fad8e57b0ebc0..4d0f7516cde0d 100644 --- a/locales/fr-FR/error.json +++ b/locales/fr-FR/error.json @@ -94,6 +94,12 @@ }, "closeMessage": "Fermer le message", "confirm": "Confirmer et réessayer", + "oauth": { + "description": "L'administrateur a activé l'authentification de connexion unique. Cliquez sur le bouton ci-dessous pour vous connecter et déverrouiller l'application.", + "success": "Connexion réussie", + "title": "Se connecter", + "welcome": "Bienvenue !" + }, "password": { "description": "L'administrateur a activé le cryptage de l'application. Entrez le mot de passe de l'application pour déverrouiller. Le mot de passe ne doit être saisi qu'une seule fois.", "placeholder": "Entrez le mot de passe", diff --git a/locales/fr-FR/setting.json b/locales/fr-FR/setting.json index 32594c41f0220..fed0e8fdf8d25 100644 --- a/locales/fr-FR/setting.json +++ b/locales/fr-FR/setting.json @@ -263,6 +263,22 @@ "placeholder": "Veuillez entrer le mot de passe d'accès", "title": "Mot de passe d'accès" }, + "oauth": { + "info": { + "desc": "Connecté", + "title": "Informations sur le compte" + }, + "signin": { + "action": "Se connecter", + "desc": "Connectez-vous avec SSO pour débloquer l'application", + "title": "Se connecter" + }, + "signout": { + "action": "Se déconnecter", + "confirm": "Confirmez-vous la déconnexion ?", + "success": "Déconnexion réussie" + } + }, "title": "Paramètres du système" }, "settingTTS": { diff --git a/locales/it-IT/common.json b/locales/it-IT/common.json index d937d58a82840..63443cfb9b625 100644 --- a/locales/it-IT/common.json +++ b/locales/it-IT/common.json @@ -108,6 +108,7 @@ "zhipu": "Zhipu AI" }, "noDescription": "Nessuna descrizione disponibile", + "oauth": "Accesso SSO", "ok": "OK", "password": "Password", "pin": "Fissa in alto", diff --git a/locales/it-IT/error.json b/locales/it-IT/error.json index 9a62a2c866efd..1799478ade90e 100644 --- a/locales/it-IT/error.json +++ b/locales/it-IT/error.json @@ -94,6 +94,12 @@ }, "closeMessage": "Chiudi messaggio", "confirm": "Conferma e riprova", + "oauth": { + "description": "L'amministratore ha abilitato l'autenticazione di accesso unificata. Fai clic sul pulsante sottostante per accedere e sbloccare l'applicazione.", + "success": "Accesso riuscito", + "title": "Accedi all'account", + "welcome": "Benvenuto!" + }, "password": { "description": "L'amministratore ha attivato la crittografia dell'applicazione. Inserisci la password dell'applicazione per sbloccarla. La password va inserita solo una volta.", "placeholder": "Inserisci la password", diff --git a/locales/it-IT/setting.json b/locales/it-IT/setting.json index db6f186c701c5..c4c99a9056b9e 100644 --- a/locales/it-IT/setting.json +++ b/locales/it-IT/setting.json @@ -263,6 +263,22 @@ "placeholder": "Inserisci la password di accesso", "title": "Password di accesso" }, + "oauth": { + "info": { + "desc": "Accesso effettuato", + "title": "Informazioni account" + }, + "signin": { + "action": "Accedi", + "desc": "Accedi tramite SSO per sbloccare l'applicazione", + "title": "Accedi all'account" + }, + "signout": { + "action": "Esci", + "confirm": "Confermi l'uscita?", + "success": "Disconnessione avvenuta con successo" + } + }, "title": "Impostazioni di sistema" }, "settingTTS": { diff --git a/locales/ja-JP/common.json b/locales/ja-JP/common.json index 9bb22fc075fea..bdda5de75cac0 100644 --- a/locales/ja-JP/common.json +++ b/locales/ja-JP/common.json @@ -108,6 +108,7 @@ "zhipu": "智譜AI" }, "noDescription": "説明はありません", + "oauth": "SSO ログイン", "ok": "OK", "password": "パスワード", "pin": "ピン留め", diff --git a/locales/ja-JP/error.json b/locales/ja-JP/error.json index b74e79fb0fc1a..2c5123b16ca95 100644 --- a/locales/ja-JP/error.json +++ b/locales/ja-JP/error.json @@ -94,6 +94,12 @@ }, "closeMessage": "ヒントを閉じる", "confirm": "確認して再試行", + "oauth": { + "description": "管理者が統一ログイン認証を有効にしました。下のボタンをクリックしてログインすると、アプリがロック解除されます。", + "success": "ログインに成功しました", + "title": "アカウントにログイン", + "welcome": "ようこそ!" + }, "password": { "description": "管理者によってアプリが暗号化されました。アプリをロック解除するには、アプリのパスワードを入力してください。パスワードは1回だけ入力すればよいです", "placeholder": "パスワードを入力してください", diff --git a/locales/ja-JP/setting.json b/locales/ja-JP/setting.json index e390e10c6003c..def40ada23620 100644 --- a/locales/ja-JP/setting.json +++ b/locales/ja-JP/setting.json @@ -263,6 +263,22 @@ "placeholder": "アクセスコードを入力してください", "title": "アクセスコード" }, + "oauth": { + "info": { + "desc": "ログイン済み", + "title": "アカウント情報" + }, + "signin": { + "action": "ログイン", + "desc": "SSO ログインを使用してアプリをロック解除", + "title": "アカウントにログイン" + }, + "signout": { + "action": "ログアウト", + "confirm": "ログアウトしますか?", + "success": "ログアウトに成功しました" + } + }, "title": "システム設定" }, "settingTTS": { diff --git a/locales/ko-KR/common.json b/locales/ko-KR/common.json index 5934c69fdddd8..682ee8fb14c7a 100644 --- a/locales/ko-KR/common.json +++ b/locales/ko-KR/common.json @@ -108,6 +108,7 @@ "zhipu": "지푸 AI" }, "noDescription": "설명 없음", + "oauth": "SSO 로그인", "ok": "확인", "password": "비밀번호", "pin": "고정", diff --git a/locales/ko-KR/error.json b/locales/ko-KR/error.json index 0ced47c5f516b..6d6afd416f574 100644 --- a/locales/ko-KR/error.json +++ b/locales/ko-KR/error.json @@ -94,6 +94,12 @@ }, "closeMessage": "알림 닫기", "confirm": "확인 및 다시 시도", + "oauth": { + "description": "관리자가 통합 로그인 인증을 활성화했습니다. 아래 버튼을 클릭하여 로그인하면 앱을 잠금 해제할 수 있습니다.", + "success": "로그인 성공", + "title": "계정 로그인", + "welcome": "환영합니다!" + }, "password": { "description": "관리자가 애플리케이션 암호화를 활성화했습니다. 애플리케이션을 잠금 해제하려면 애플리케이션 비밀번호를 입력하십시오. 비밀번호는 한 번만 입력하면 됩니다.", "placeholder": "비밀번호를 입력하세요", diff --git a/locales/ko-KR/setting.json b/locales/ko-KR/setting.json index b0e23fdecb786..4eb8c1b7d4223 100644 --- a/locales/ko-KR/setting.json +++ b/locales/ko-KR/setting.json @@ -263,6 +263,22 @@ "placeholder": "액세스 암호를 입력하세요", "title": "액세스 암호" }, + "oauth": { + "info": { + "desc": "로그인됨", + "title": "계정 정보" + }, + "signin": { + "action": "로그인", + "desc": "SSO를 사용하여 앱 잠금 해제", + "title": "계정 로그인" + }, + "signout": { + "action": "로그아웃", + "confirm": "로그아웃 하시겠습니까?", + "success": "로그아웃 성공" + } + }, "title": "시스템 설정" }, "settingTTS": { diff --git a/locales/nl-NL/common.json b/locales/nl-NL/common.json index d946bf6addbbe..6a3b340df54b5 100644 --- a/locales/nl-NL/common.json +++ b/locales/nl-NL/common.json @@ -108,6 +108,7 @@ "zhipu": "智谱AI" }, "noDescription": "Geen beschrijving beschikbaar", + "oauth": "SSO inloggen", "ok": "Oké", "password": "Wachtwoord", "pin": "Vastzetten", diff --git a/locales/nl-NL/error.json b/locales/nl-NL/error.json index d639d6b0ddbad..919b09b0d27f2 100644 --- a/locales/nl-NL/error.json +++ b/locales/nl-NL/error.json @@ -94,6 +94,12 @@ }, "closeMessage": "Sluit bericht", "confirm": "Bevestigen en opnieuw proberen", + "oauth": { + "description": "De beheerder heeft een uniforme aanmeldingsverificatie ingeschakeld. Klik op de onderstaande knop om in te loggen en de app te ontgrendelen.", + "success": "Succesvol ingelogd", + "title": "Account inloggen", + "welcome": "Welkom!" + }, "password": { "description": "De beheerder heeft app-encryptie ingeschakeld. Voer het app-wachtwoord in om de app te ontgrendelen. Het wachtwoord hoeft slechts één keer te worden ingevoerd.", "placeholder": "Voer het wachtwoord in", diff --git a/locales/nl-NL/setting.json b/locales/nl-NL/setting.json index 3e421251b99a5..63bdfb9f616e4 100644 --- a/locales/nl-NL/setting.json +++ b/locales/nl-NL/setting.json @@ -263,6 +263,22 @@ "placeholder": "Voer toegangswachtwoord in", "title": "Toegangswachtwoord" }, + "oauth": { + "info": { + "desc": "已登录", + "title": "Account Information" + }, + "signin": { + "action": "Sign In", + "desc": "Sign in using SSO to unlock the app", + "title": "Sign In to Your Account" + }, + "signout": { + "action": "Sign Out", + "confirm": "Confirm sign out?", + "success": "Sign out successful" + } + }, "title": "Systeeminstellingen" }, "settingTTS": { diff --git a/locales/pl-PL/common.json b/locales/pl-PL/common.json index 50c60808a30a5..fddfea633156b 100644 --- a/locales/pl-PL/common.json +++ b/locales/pl-PL/common.json @@ -108,6 +108,7 @@ "zhipu": "智谱AI" }, "noDescription": "Brak opisu", + "oauth": "Logowanie SSO", "ok": "OK", "password": "Hasło", "pin": "Przypnij", diff --git a/locales/pl-PL/error.json b/locales/pl-PL/error.json index 96537d43400de..10b0569784fac 100644 --- a/locales/pl-PL/error.json +++ b/locales/pl-PL/error.json @@ -94,6 +94,12 @@ }, "closeMessage": "Zamknij komunikat", "confirm": "Potwierdź i spróbuj ponownie", + "oauth": { + "description": "Administrator włączył jednolite uwierzytelnianie logowania. Kliknij poniższy przycisk, aby się zalogować i odblokować aplikację.", + "success": "Zalogowano pomyślnie", + "title": "Zaloguj się", + "welcome": "Witaj!" + }, "password": { "description": "Administrator włączył szyfrowanie aplikacji. Po wprowadzeniu hasła aplikacja zostanie odblokowana. Hasło należy wprowadzić tylko raz.", "placeholder": "Wprowadź hasło", diff --git a/locales/pl-PL/setting.json b/locales/pl-PL/setting.json index 8070c7f1472e7..11cdda67ada97 100644 --- a/locales/pl-PL/setting.json +++ b/locales/pl-PL/setting.json @@ -263,6 +263,22 @@ "placeholder": "Wprowadź hasło dostępu", "title": "Hasło dostępu" }, + "oauth": { + "info": { + "desc": "Zalogowano", + "title": "Informacje o koncie" + }, + "signin": { + "action": "Zaloguj się", + "desc": "Zaloguj się za pomocą SSO, aby odblokować aplikację", + "title": "Zaloguj się na konto" + }, + "signout": { + "action": "Wyloguj się", + "confirm": "Czy na pewno chcesz się wylogować?", + "success": "Wylogowanie zakończone pomyślnie" + } + }, "title": "Ustawienia systemowe" }, "settingTTS": { diff --git a/locales/pt-BR/common.json b/locales/pt-BR/common.json index 15573cbe73fcb..18ec0c5cc71b5 100644 --- a/locales/pt-BR/common.json +++ b/locales/pt-BR/common.json @@ -108,6 +108,7 @@ "zhipu": "Zhipu AI" }, "noDescription": "Sem descrição", + "oauth": "Login SSO", "ok": "OK", "password": "Senha", "pin": "Fixar", diff --git a/locales/pt-BR/error.json b/locales/pt-BR/error.json index 02e4b2bfe4d93..2c8e0491c1b20 100644 --- a/locales/pt-BR/error.json +++ b/locales/pt-BR/error.json @@ -94,6 +94,12 @@ }, "closeMessage": "Fechar mensagem", "confirm": "Confirmar e tentar novamente", + "oauth": { + "description": "O administrador ativou a autenticação de login unificado. Clique no botão abaixo para fazer login e desbloquear o aplicativo.", + "success": "Login bem-sucedido", + "title": "Faça login na sua conta", + "welcome": "Bem-vindo!" + }, "password": { "description": "O administrador ativou a criptografia do aplicativo. Insira a senha do aplicativo para desbloqueá-lo. A senha só precisa ser inserida uma vez.", "placeholder": "Insira a senha", diff --git a/locales/pt-BR/setting.json b/locales/pt-BR/setting.json index b4f8b0786dbb4..0e4b8926beeb4 100644 --- a/locales/pt-BR/setting.json +++ b/locales/pt-BR/setting.json @@ -263,6 +263,22 @@ "placeholder": "Digite a senha de acesso", "title": "Senha de acesso" }, + "oauth": { + "info": { + "desc": "Logado", + "title": "Informações da conta" + }, + "signin": { + "action": "Entrar", + "desc": "Faça login com SSO para desbloquear o aplicativo", + "title": "Entrar na conta" + }, + "signout": { + "action": "Sair", + "confirm": "Confirmar saída?", + "success": "Saiu da conta com sucesso" + } + }, "title": "Configurações do sistema" }, "settingTTS": { diff --git a/locales/ru-RU/common.json b/locales/ru-RU/common.json index 0f34880b76a29..039086dc0b48f 100644 --- a/locales/ru-RU/common.json +++ b/locales/ru-RU/common.json @@ -108,6 +108,7 @@ "zhipu": "Zhipu AI" }, "noDescription": "Нет описания", + "oauth": "Вход через единую учетную запись (SSO)", "ok": "ОК", "password": "Пароль", "pin": "Закрепить", diff --git a/locales/ru-RU/error.json b/locales/ru-RU/error.json index 930f5a6829f03..0b9236dd358b5 100644 --- a/locales/ru-RU/error.json +++ b/locales/ru-RU/error.json @@ -94,6 +94,12 @@ }, "closeMessage": "Закрыть сообщение", "confirm": "Подтвердить и повторить попытку", + "oauth": { + "description": "Администратор включил единую систему аутентификации. Нажмите кнопку ниже, чтобы войти и разблокировать приложение.", + "success": "Успешный вход", + "title": "Вход в аккаунт", + "welcome": "Добро пожаловать!" + }, "password": { "description": "Шифрование приложения включено администратором. Введите пароль приложения, чтобы разблокировать приложение. Пароль необходимо ввести только один раз.", "placeholder": "Введите пароль", diff --git a/locales/ru-RU/setting.json b/locales/ru-RU/setting.json index 9c5e61d9dc9d6..df63399f8bb46 100644 --- a/locales/ru-RU/setting.json +++ b/locales/ru-RU/setting.json @@ -263,6 +263,22 @@ "placeholder": "Введите код доступа", "title": "Код доступа" }, + "oauth": { + "info": { + "desc": "Вход выполнен", + "title": "Информация об аккаунте" + }, + "signin": { + "action": "Войти", + "desc": "Войдите через SSO, чтобы разблокировать приложение", + "title": "Вход в аккаунт" + }, + "signout": { + "action": "Выйти", + "confirm": "Подтвердить выход?", + "success": "Вы успешно вышли из системы" + } + }, "title": "Системные настройки" }, "settingTTS": { diff --git a/locales/tr-TR/common.json b/locales/tr-TR/common.json index b5a84b574ec8b..e2cef2e39b3d3 100644 --- a/locales/tr-TR/common.json +++ b/locales/tr-TR/common.json @@ -108,6 +108,7 @@ "zhipu": "Zhipu AI" }, "noDescription": "Açıklama yok", + "oauth": "SSO Girişi", "ok": "Tamam", "password": "Password", "pin": "Pin", diff --git a/locales/tr-TR/error.json b/locales/tr-TR/error.json index d48106508e35f..1b46e8df02f3d 100644 --- a/locales/tr-TR/error.json +++ b/locales/tr-TR/error.json @@ -94,6 +94,12 @@ }, "closeMessage": "Mesajı kapat", "confirm": "Onayla ve Yeniden Dene", + "oauth": { + "description": "Yönetici, tek oturum açma kimlik doğrulamasını etkinleştirdi. Aşağıdaki düğmeye tıklayarak giriş yapabilir ve uygulamayı kilidini açabilirsiniz.", + "success": "Giriş başarılı", + "title": "Hesaba giriş yap", + "welcome": "Hoş geldiniz!" + }, "password": { "description": "Uygulama şifrelemesi yönetici tarafından etkinleştirilmiştir. Uygulamayı açmak için uygulama şifresini girin. Şifre sadece bir kez doldurulmalıdır.", "placeholder": "Lütfen şifre girin", diff --git a/locales/tr-TR/setting.json b/locales/tr-TR/setting.json index 74846a47be6c1..f62941a5ca74c 100644 --- a/locales/tr-TR/setting.json +++ b/locales/tr-TR/setting.json @@ -263,6 +263,22 @@ "placeholder": "Erişim şifresini girin", "title": "Erişim Şifresi" }, + "oauth": { + "info": { + "desc": "Oturum açıldı", + "title": "Hesap Bilgisi" + }, + "signin": { + "action": "Oturum aç", + "desc": "Uygulamayı kilidini açmak için SSO ile oturum açın", + "title": "Hesaba Giriş Yap" + }, + "signout": { + "action": "Oturumu kapat", + "confirm": "Çıkış yapmak istediğinize emin misiniz?", + "success": "Oturum kapatma başarılı" + } + }, "title": "Sistem Ayarları" }, "settingTTS": { diff --git a/locales/vi-VN/common.json b/locales/vi-VN/common.json index 3356fae47476c..956759ba5de39 100644 --- a/locales/vi-VN/common.json +++ b/locales/vi-VN/common.json @@ -108,6 +108,7 @@ "zhipu": "Zhipu AI" }, "noDescription": "Chưa có mô tả", + "oauth": "Đăng nhập SSO", "ok": "Đồng ý", "password": "Mật khẩu", "pin": "Ghim", diff --git a/locales/vi-VN/error.json b/locales/vi-VN/error.json index 4ee50831b9778..f90aaca8fe6dc 100644 --- a/locales/vi-VN/error.json +++ b/locales/vi-VN/error.json @@ -94,6 +94,12 @@ }, "closeMessage": "Đóng thông báo", "confirm": "Xác nhận và thử lại", + "oauth": { + "description": "Quản trị viên đã mở tính năng xác thực đăng nhập thống nhất. Nhấn vào nút bên dưới để đăng nhập và mở khóa ứng dụng", + "success": "Đăng nhập thành công", + "title": "Đăng nhập tài khoản", + "welcome": "Chào mừng bạn!" + }, "password": { "description": "Quản trị viên đã kích hoạt mã hóa ứng dụng. Nhập mật khẩu ứng dụng để mở khóa. Chỉ cần nhập mật khẩu một lần", "placeholder": "Nhập mật khẩu", diff --git a/locales/vi-VN/setting.json b/locales/vi-VN/setting.json index 2a24a0178613a..f3349c83c794b 100644 --- a/locales/vi-VN/setting.json +++ b/locales/vi-VN/setting.json @@ -263,6 +263,22 @@ "placeholder": "Nhập mật khẩu truy cập", "title": "Mật khẩu truy cập" }, + "oauth": { + "info": { + "desc": "Đã đăng nhập", + "title": "Thông tin tài khoản" + }, + "signin": { + "action": "Đăng nhập", + "desc": "Đăng nhập bằng SSO để mở khóa ứng dụng", + "title": "Đăng nhập tài khoản" + }, + "signout": { + "action": "Đăng xuất", + "confirm": "Xác nhận đăng xuất?", + "success": "Đăng xuất thành công" + } + }, "title": "Cài đặt hệ thống" }, "settingTTS": { diff --git a/locales/zh-CN/common.json b/locales/zh-CN/common.json index 0e7b379ed763c..9945bc98036ce 100644 --- a/locales/zh-CN/common.json +++ b/locales/zh-CN/common.json @@ -108,6 +108,7 @@ "zhipu": "智谱AI" }, "noDescription": "暂无描述", + "oauth": "SSO 登录", "ok": "确定", "password": "密码", "pin": "置顶", diff --git a/locales/zh-CN/error.json b/locales/zh-CN/error.json index aaf64e2eec309..002894c07ac16 100644 --- a/locales/zh-CN/error.json +++ b/locales/zh-CN/error.json @@ -94,6 +94,12 @@ }, "closeMessage": "关闭提示", "confirm": "确认并重试", + "oauth": { + "description": "管理员已开启统一登录认证,点击下方按钮登录,即可解锁应用", + "success": "登录成功", + "title": "登录账号", + "welcome": "欢迎你!" + }, "password": { "description": "管理员已开启应用加密,输入应用密码后即可解锁应用。密码只需填写一次", "placeholder": "请输入密码", diff --git a/locales/zh-CN/setting.json b/locales/zh-CN/setting.json index 6ffa94d64755a..99165555afdd1 100644 --- a/locales/zh-CN/setting.json +++ b/locales/zh-CN/setting.json @@ -263,6 +263,22 @@ "placeholder": "请输入访问密码", "title": "访问密码" }, + "oauth": { + "info": { + "desc": "已登录", + "title": "账户信息" + }, + "signin": { + "action": "登录", + "desc": "使用 SSO 登录以解锁应用", + "title": "登录账号" + }, + "signout": { + "action": "退出登录", + "confirm": "确认退出?", + "success": "退出登录成功" + } + }, "title": "系统设置" }, "settingTTS": { diff --git a/locales/zh-TW/common.json b/locales/zh-TW/common.json index 4cfd0ce5b9208..fda59335386c0 100644 --- a/locales/zh-TW/common.json +++ b/locales/zh-TW/common.json @@ -108,6 +108,7 @@ "zhipu": "智譜AI" }, "noDescription": "暫無描述", + "oauth": "單一登錄(SSO)", "ok": "確定", "password": "密碼", "pin": "置頂", diff --git a/locales/zh-TW/error.json b/locales/zh-TW/error.json index f6a1a81e9a423..6a5def9494261 100644 --- a/locales/zh-TW/error.json +++ b/locales/zh-TW/error.json @@ -94,6 +94,12 @@ }, "closeMessage": "關閉提示", "confirm": "確認並重試", + "oauth": { + "description": "管理員已開啟統一登錄認證,點擊下方按鈕登錄,即可解鎖應用", + "success": "登錄成功", + "title": "登錄帳號", + "welcome": "歡迎你!" + }, "password": { "description": "管理員已啟用應用程式加密,輸入應用程式密碼後即可解鎖應用程式。密碼只需填寫一次。", "placeholder": "請輸入密碼", diff --git a/locales/zh-TW/setting.json b/locales/zh-TW/setting.json index 7a806a5ec32fa..1e1fbff3e2242 100644 --- a/locales/zh-TW/setting.json +++ b/locales/zh-TW/setting.json @@ -263,6 +263,22 @@ "placeholder": "請輸入訪問密碼", "title": "訪問密碼" }, + "oauth": { + "info": { + "desc": "已登錄", + "title": "帳戶資訊" + }, + "signin": { + "action": "登錄", + "desc": "使用 SSO 登錄以解鎖應用", + "title": "登錄帳號" + }, + "signout": { + "action": "退出登錄", + "confirm": "確認退出?", + "success": "退出登錄成功" + } + }, "title": "系統設定" }, "settingTTS": { diff --git a/package.json b/package.json index 693fd4822225b..a793c84f6045c 100644 --- a/package.json +++ b/package.json @@ -105,6 +105,7 @@ "modern-screenshot": "^4", "nanoid": "^5", "next": "^14.1", + "next-auth": "beta", "numeral": "^2.0.6", "nuqs": "^1.15.4", "openai": "^4.22", diff --git a/src/app/api/auth.ts b/src/app/api/auth.ts index 1168aed807af5..2e25de2d97d15 100644 --- a/src/app/api/auth.ts +++ b/src/app/api/auth.ts @@ -4,9 +4,15 @@ import { ChatErrorType } from '@/types/fetch'; interface AuthConfig { accessCode?: string | null; apiKey?: string | null; + oauthAuthorized?: boolean; } -export const checkAuth = ({ apiKey, accessCode }: AuthConfig) => { +export const checkAuth = ({ apiKey, accessCode, oauthAuthorized }: AuthConfig) => { + // If authorized by oauth + if (oauthAuthorized) { + return { auth: true }; + } + const { ACCESS_CODES } = getServerConfig(); // if apiKey exist diff --git a/src/app/api/chat/[provider]/route.ts b/src/app/api/chat/[provider]/route.ts index 3d2d7eb1b60aa..35ee9d4743591 100644 --- a/src/app/api/chat/[provider]/route.ts +++ b/src/app/api/chat/[provider]/route.ts @@ -1,6 +1,6 @@ import { getPreferredRegion } from '@/app/api/config'; import { createErrorResponse } from '@/app/api/errorResponse'; -import { LOBE_CHAT_AUTH_HEADER } from '@/const/auth'; +import { LOBE_CHAT_AUTH_HEADER, OAUTH_AUTHORIZED } from '@/const/auth'; import { AgentInitErrorPayload, AgentRuntimeError, @@ -10,7 +10,7 @@ import { import { ChatErrorType } from '@/types/fetch'; import { ChatStreamPayload } from '@/types/openai/chat'; -import { checkPasswordOrUseUserApiKey, getJWTPayload } from '../auth'; +import { checkAuthMethod, getJWTPayload } from '../auth'; import AgentRuntime from './agentRuntime'; export const runtime = 'edge'; @@ -25,11 +25,13 @@ export const POST = async (req: Request, { params }: { params: { provider: strin try { // get Authorization from header const authorization = req.headers.get(LOBE_CHAT_AUTH_HEADER); + const oauthAuthorized = !!req.headers.get(OAUTH_AUTHORIZED); + if (!authorization) throw AgentRuntimeError.createError(ChatErrorType.Unauthorized); // check the Auth With payload const payload = await getJWTPayload(authorization); - checkPasswordOrUseUserApiKey(payload.accessCode, payload.apiKey); + checkAuthMethod(payload.accessCode, payload.apiKey, oauthAuthorized); const body = await req.clone().json(); agentRuntime = await AgentRuntime.initializeWithUserPayload(params.provider, payload, { diff --git a/src/app/api/chat/auth.ts b/src/app/api/chat/auth.ts index 52f9d0cc2ffcc..c0cb82bdd65de 100644 --- a/src/app/api/chat/auth.ts +++ b/src/app/api/chat/auth.ts @@ -31,14 +31,22 @@ export const getJWTPayload = async (token: string): Promise => { }; /** - * Check if the provided access code is valid or if a user API key should be used. + * Check if the provided access code is valid, a user API key should be used or the OAuth 2 header is provided. * * @param {string} accessCode - The access code to check. * @param {string} apiKey - The user API key. + * @param {boolean} oauthAuthorized - Whether the OAuth 2 header is provided. * @throws {AgentRuntimeError} If the access code is invalid and no user API key is provided. */ -export const checkPasswordOrUseUserApiKey = (accessCode?: string, apiKey?: string) => { - const { ACCESS_CODES } = getServerConfig(); +export const checkAuthMethod = ( + accessCode?: string, + apiKey?: string, + oauthAuthorized?: boolean, +) => { + const { ACCESS_CODES, ENABLE_OAUTH_SSO } = getServerConfig(); + + // if OAuth 2 header is provided + if (ENABLE_OAUTH_SSO && oauthAuthorized) return; // if apiKey exist if (apiKey) return; diff --git a/src/app/api/chat/google/route.ts b/src/app/api/chat/google/route.ts index e4b54734600db..553bf9635880f 100644 --- a/src/app/api/chat/google/route.ts +++ b/src/app/api/chat/google/route.ts @@ -1,6 +1,6 @@ import { createErrorResponse } from '@/app/api/errorResponse'; import { getServerConfig } from '@/config/server'; -import { LOBE_CHAT_AUTH_HEADER } from '@/const/auth'; +import { LOBE_CHAT_AUTH_HEADER, OAUTH_AUTHORIZED } from '@/const/auth'; import { AgentInitErrorPayload, AgentRuntimeError, @@ -11,7 +11,7 @@ import { import { ChatErrorType } from '@/types/fetch'; import { ChatStreamPayload } from '@/types/openai/chat'; -import { checkPasswordOrUseUserApiKey, getJWTPayload } from '../auth'; +import { checkAuthMethod, getJWTPayload } from '../auth'; // due to the Chinese region does not support accessing Google // we need to use proxy to access it @@ -49,11 +49,13 @@ export const POST = async (req: Request) => { try { // get Authorization from header const authorization = req.headers.get(LOBE_CHAT_AUTH_HEADER); + const oauthAuthorized = !!req.headers.get(OAUTH_AUTHORIZED); + if (!authorization) throw AgentRuntimeError.createError(ChatErrorType.Unauthorized); // check the Auth With payload const payload = await getJWTPayload(authorization); - checkPasswordOrUseUserApiKey(payload.accessCode, payload.apiKey); + checkAuthMethod(payload.accessCode, payload.apiKey, oauthAuthorized); const { GOOGLE_API_KEY } = getServerConfig(); const apiKey = payload?.apiKey || GOOGLE_API_KEY; diff --git a/src/app/api/config/route.ts b/src/app/api/config/route.ts index 99e7ade94fb0c..a389ab182954b 100644 --- a/src/app/api/config/route.ts +++ b/src/app/api/config/route.ts @@ -7,11 +7,18 @@ export const runtime = 'edge'; * get Server config to client */ export const GET = async () => { - const { CUSTOM_MODELS, ENABLED_MOONSHOT, ENABLED_ZHIPU, ENABLED_AWS_BEDROCK, ENABLED_GOOGLE } = - getServerConfig(); + const { + CUSTOM_MODELS, + ENABLED_MOONSHOT, + ENABLED_ZHIPU, + ENABLED_AWS_BEDROCK, + ENABLED_GOOGLE, + ENABLE_OAUTH_SSO, + } = getServerConfig(); const config: GlobalServerConfig = { customModelName: CUSTOM_MODELS, + enabledOAuthSSO: ENABLE_OAUTH_SSO, languageModel: { bedrock: { enabled: ENABLED_AWS_BEDROCK }, google: { enabled: ENABLED_GOOGLE }, diff --git a/src/app/api/oauth/[...nextauth]/route.ts b/src/app/api/oauth/[...nextauth]/route.ts new file mode 100644 index 0000000000000..9fb4e1c36ef05 --- /dev/null +++ b/src/app/api/oauth/[...nextauth]/route.ts @@ -0,0 +1,3 @@ +export { GET, POST } from '../next-auth'; + +export const runtime = 'edge'; // optional diff --git a/src/app/api/oauth/next-auth.ts b/src/app/api/oauth/next-auth.ts new file mode 100644 index 0000000000000..1a642098a3fcd --- /dev/null +++ b/src/app/api/oauth/next-auth.ts @@ -0,0 +1,21 @@ +import NextAuth from 'next-auth'; +import Auth0 from 'next-auth/providers/auth0'; + +import { getServerConfig } from '@/config/server'; + +const { AUTH0_CLIENT_ID, AUTH0_CLIENT_SECRET, AUTH0_ISSUER } = getServerConfig(); + +const nextAuth = NextAuth({ + providers: [ + Auth0({ + clientId: AUTH0_CLIENT_ID, + clientSecret: AUTH0_CLIENT_SECRET, + issuer: AUTH0_ISSUER, + }), + ], +}); + +export const { + handlers: { GET, POST }, + auth, +} = nextAuth; diff --git a/src/app/api/openai/createBizOpenAI/index.ts b/src/app/api/openai/createBizOpenAI/index.ts index a62527f93b334..dfe49b7dbf9cf 100644 --- a/src/app/api/openai/createBizOpenAI/index.ts +++ b/src/app/api/openai/createBizOpenAI/index.ts @@ -14,9 +14,10 @@ import { createOpenai } from './createOpenai'; * if auth not pass ,just return error response */ export const createBizOpenAI = (req: Request, model: string): Response | OpenAI => { - const { apiKey, accessCode, endpoint, useAzure, apiVersion } = getOpenAIAuthFromRequest(req); + const { apiKey, accessCode, endpoint, useAzure, apiVersion, oauthAuthorized } = + getOpenAIAuthFromRequest(req); - const result = checkAuth({ accessCode, apiKey }); + const result = checkAuth({ accessCode, apiKey, oauthAuthorized }); if (!result.auth) { return createErrorResponse(result.error as ErrorType); diff --git a/src/app/api/plugin/gateway/route.ts b/src/app/api/plugin/gateway/route.ts index 310ff946ffa2d..c3f2ed0e3c970 100644 --- a/src/app/api/plugin/gateway/route.ts +++ b/src/app/api/plugin/gateway/route.ts @@ -7,12 +7,15 @@ import { ChatErrorType, ErrorType } from '@/types/fetch'; import { parserPluginSettings } from './settings'; -const checkAuth = (accessCode: string | null) => { - const { ACCESS_CODES, PLUGIN_SETTINGS } = getServerConfig(); +const checkAuth = (accessCode: string | null, oauthAuthorized: boolean | null) => { + const { ACCESS_CODES, PLUGIN_SETTINGS, ENABLE_OAUTH_SSO } = getServerConfig(); // if there is no plugin settings, just skip the auth if (!PLUGIN_SETTINGS) return { auth: true }; + // If authorized by oauth + if (oauthAuthorized && ENABLE_OAUTH_SSO) return { auth: true }; + // if accessCode doesn't exist if (!ACCESS_CODES.length) return { auth: true }; @@ -30,9 +33,9 @@ const defaultPluginSettings = parserPluginSettings(PLUGIN_SETTINGS); const handler = createGatewayOnEdgeRuntime({ defaultPluginSettings, pluginsIndexUrl }); export const POST = async (req: Request) => { - const { accessCode } = getOpenAIAuthFromRequest(req); + const { accessCode, oauthAuthorized } = getOpenAIAuthFromRequest(req); - const result = checkAuth(accessCode); + const result = checkAuth(accessCode, oauthAuthorized); if (!result.auth) { return createErrorResponse(result.error as ErrorType); diff --git a/src/app/settings/common/Common.tsx b/src/app/settings/common/Common.tsx index 706709508b6b8..c4e22e8c317e2 100644 --- a/src/app/settings/common/Common.tsx +++ b/src/app/settings/common/Common.tsx @@ -2,6 +2,7 @@ import { Form, type ItemGroup, SelectWithImg, SliderWithInput } from '@lobehub/u import { Form as AntForm, App, Button, Input, Select } from 'antd'; import isEqual from 'fast-deep-equal'; import { AppWindow, Monitor, Moon, Palette, Sun } from 'lucide-react'; +import { signIn, signOut, useSession } from 'next-auth/react'; import { memo, useCallback, useEffect } from 'react'; import { useTranslation } from 'react-i18next'; @@ -23,12 +24,16 @@ type SettingItemGroup = ItemGroup; export interface SettingsCommonProps { showAccessCodeConfig: boolean; + showOAuthLogin: boolean; } -const Common = memo(({ showAccessCodeConfig }) => { +const Common = memo(({ showAccessCodeConfig, showOAuthLogin }) => { const { t } = useTranslation('setting'); const [form] = AntForm.useForm(); + const { data: session, status } = useSession(); + const isOAuthLoggedIn = status === 'authenticated' && session && session.user; + const [clearSessions, clearSessionGroups] = useSessionStore((s) => [ s.clearSessions, s.clearSessionGroups, @@ -49,6 +54,22 @@ const Common = memo(({ showAccessCodeConfig }) => { const { message, modal } = App.useApp(); + const handleSignOut = useCallback(() => { + modal.confirm({ + centered: true, + okButtonProps: { danger: true }, + onOk: () => { + signOut(); + message.success(t('settingSystem.oauth.signout.success')); + }, + title: t('settingSystem.oauth.signout.confirm'), + }); + }, []); + + const handleSignIn = useCallback(() => { + signIn('auth0'); + }, []); + const handleReset = useCallback(() => { modal.confirm({ centered: true, @@ -196,6 +217,23 @@ const Common = memo(({ showAccessCodeConfig }) => { label: t('settingSystem.accessCode.title'), name: 'password', }, + { + children: isOAuthLoggedIn ? ( + + ) : ( + + ), + desc: isOAuthLoggedIn + ? `${session.user?.email} ${t('settingSystem.oauth.info.desc')}` + : t('settingSystem.oauth.signin.desc'), + hidden: !showOAuthLogin, + label: isOAuthLoggedIn + ? t('settingSystem.oauth.info.title') + : t('settingSystem.oauth.signin.title'), + minWidth: undefined, + }, { children: ( + ) : ( + + )} + + + {isOAuthLoggedIn ? ( + + ) : ( + + )} + + + ); +}); + +export default OAuthForm; diff --git a/src/layout/GlobalLayout/index.tsx b/src/layout/GlobalLayout/index.tsx index d5ddc831ba358..ab6348bfe7495 100644 --- a/src/layout/GlobalLayout/index.tsx +++ b/src/layout/GlobalLayout/index.tsx @@ -3,6 +3,7 @@ import { App } from 'antd'; import { createStyles } from 'antd-style'; import 'antd/dist/reset.css'; +import { SessionProvider } from 'next-auth/react'; import dynamic from 'next/dynamic'; import { FC, PropsWithChildren, memo } from 'react'; @@ -47,13 +48,15 @@ interface GlobalLayoutProps extends AppThemeProps { } const GlobalLayout = ({ children, defaultLang, ...theme }: GlobalLayoutProps) => ( - - - - {children} - - - + + + + + {children} + + + + ); export default GlobalLayout; diff --git a/src/locales/default/common.ts b/src/locales/default/common.ts index f547a16440cce..3e6940f3744b5 100644 --- a/src/locales/default/common.ts +++ b/src/locales/default/common.ts @@ -108,6 +108,7 @@ export default { zhipu: '智谱AI', }, noDescription: '暂无描述', + oauth: 'SSO 登录', ok: '确定', password: '密码', pin: '置顶', diff --git a/src/locales/default/error.ts b/src/locales/default/error.ts index cf60ae3dd24dd..5510da620c99c 100644 --- a/src/locales/default/error.ts +++ b/src/locales/default/error.ts @@ -110,6 +110,12 @@ export default { }, closeMessage: '关闭提示', confirm: '确认并重试', + oauth: { + description: '管理员已开启统一登录认证,点击下方按钮登录,即可解锁应用', + success: '登录成功', + title: '登录账号', + welcome: '欢迎你!', + }, password: { description: '管理员已开启应用加密,输入应用密码后即可解锁应用。密码只需填写一次', placeholder: '请输入密码', diff --git a/src/locales/default/setting.ts b/src/locales/default/setting.ts index ed75ea6f7903a..ec71613f40c08 100644 --- a/src/locales/default/setting.ts +++ b/src/locales/default/setting.ts @@ -265,6 +265,22 @@ export default { placeholder: '请输入访问密码', title: '访问密码', }, + oauth: { + info: { + desc: '已登录', + title: '账户信息', + }, + signin: { + action: '登录', + desc: '使用 SSO 登录以解锁应用', + title: '登录账号', + }, + signout: { + action: '退出登录', + confirm: '确认退出?', + success: '退出登录成功', + }, + }, title: '系统设置', }, settingTTS: { diff --git a/src/middleware.ts b/src/middleware.ts new file mode 100644 index 0000000000000..7276632eb7d56 --- /dev/null +++ b/src/middleware.ts @@ -0,0 +1,25 @@ +// export { auth as middleware } from './app/api/next-auth'; +import { NextResponse } from 'next/server'; + +import { auth } from './app/api/oauth/next-auth'; +import { OAUTH_AUTHORIZED } from './const/auth'; + +export const config = { + matcher: '/api/:path*', +}; + +export default auth((req) => { + // Just check if session exists + const session = req.auth; + const isLoggedIn = !!session; + + // Remove & amend OAuth authorized header + const requestHeaders = new Headers(req.headers); + requestHeaders.delete(OAUTH_AUTHORIZED); + if (isLoggedIn) requestHeaders.set(OAUTH_AUTHORIZED, 'true'); + return NextResponse.next({ + request: { + headers: requestHeaders, + }, + }); +}); diff --git a/src/store/global/slices/common/initialState.ts b/src/store/global/slices/common/initialState.ts index 8e5e43c97d29d..82e4a19e57cec 100644 --- a/src/store/global/slices/common/initialState.ts +++ b/src/store/global/slices/common/initialState.ts @@ -1,6 +1,5 @@ import { AppRouterInstance } from 'next/dist/shared/lib/app-router-context.shared-runtime'; - export enum SidebarTabKey { Chat = 'chat', Market = 'market', diff --git a/src/store/global/slices/common/selectors.ts b/src/store/global/slices/common/selectors.ts index cfb84feae7100..3e4f0ff0fbb5a 100644 --- a/src/store/global/slices/common/selectors.ts +++ b/src/store/global/slices/common/selectors.ts @@ -1,5 +1,6 @@ import { GlobalStore } from '@/store/global'; export const commonSelectors = { + enabledOAuthSSO: (s: GlobalStore) => s.serverConfig.enabledOAuthSSO, userAvatar: (s: GlobalStore) => s.avatar || '', }; diff --git a/src/types/settings/index.ts b/src/types/settings/index.ts index 266d6978975b1..c3a73890d32c9 100644 --- a/src/types/settings/index.ts +++ b/src/types/settings/index.ts @@ -21,6 +21,7 @@ export interface GlobalTool { export interface GlobalServerConfig { customModelName?: string; defaultAgent?: DeepPartial; + enabledOAuthSSO?: boolean; languageModel?: DeepPartial; } diff --git a/tsconfig.json b/tsconfig.json index 1de249cba2ebc..4d0ff329a02a5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -19,13 +19,13 @@ "types": ["vitest/globals"], "paths": { "@/*": ["./src/*"], - "~test-utils": ["./tests/utils.tsx"], + "~test-utils": ["./tests/utils.tsx"] }, "plugins": [ { - "name": "next", - }, - ], + "name": "next" + } + ] }, "exclude": ["node_modules"], "include": [ @@ -36,11 +36,11 @@ "**/*.ts", "**/*.d.ts", "**/*.tsx", - ".next/types/**/*.ts", + ".next/types/**/*.ts" ], "ts-node": { "compilerOptions": { - "module": "commonjs", - }, - }, + "module": "commonjs" + } + } }