From f4e3c2503511109f53443282d6ccfc13b449c4f5 Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Sun, 29 Sep 2024 15:11:46 +0800 Subject: [PATCH 1/3] feat: remove the button for viewing passwords in the Edge browser (#6727) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### What type of PR is this? /area core /kind improvement /milestone 2.20.x #### What this PR does / why we need it: 移除在 Edge 浏览器中,为密码输入框添加显示密码明文按钮。 image #### Does this PR introduce a user-facing change? ```release-note None ``` --- application/src/main/resources/static/styles/main.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/application/src/main/resources/static/styles/main.css b/application/src/main/resources/static/styles/main.css index 9d062b00070..b449f94f931 100644 --- a/application/src/main/resources/static/styles/main.css +++ b/application/src/main/resources/static/styles/main.css @@ -408,3 +408,7 @@ flex-direction: column; } } + +::-ms-reveal { + display: none; +} \ No newline at end of file From 2c849d83614cd8d2276d3e85e1533034e5a68661 Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Sun, 29 Sep 2024 15:47:46 +0800 Subject: [PATCH 2/3] chore: regenerate api client for login-related (#6728) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### What type of PR is this? /area core /kind cleanup /milestone 2.20.x #### What this PR does / why we need it: 重新生成 OpenAPI 定义和 API Client,在 https://github.com/halo-dev/halo/pull/6488 中忘了重新生成。 #### Does this PR introduce a user-facing change? ```release-note None ``` --- api-docs/openapi/v3_0/aggregated.json | 222 +-------- .../v3_0/apis_console.api_v1alpha1.json | 13 + .../v3_0/apis_extension.api_v1alpha1.json | 13 + .../v3_0/apis_public.api_v1alpha1.json | 298 ------------ ui/packages/api-client/entry/api-client.ts | 4 - .../api-client/src/.openapi-generator/FILES | 7 - ui/packages/api-client/src/api.ts | 2 - ui/packages/api-client/src/api/login-api.ts | 128 ----- .../src/api/user-v1alpha1-public-api.ts | 438 ------------------ .../src/models/auth-provider-spec.ts | 26 ++ ui/packages/api-client/src/models/index.ts | 5 - .../models/password-reset-email-request.ts | 36 -- .../src/models/public-key-response.ts | 30 -- .../models/register-verify-email-request.ts | 30 -- .../src/models/reset-password-request.ts | 36 -- .../api-client/src/models/sign-up-request.ts | 45 -- 16 files changed, 65 insertions(+), 1268 deletions(-) delete mode 100644 ui/packages/api-client/src/api/login-api.ts delete mode 100644 ui/packages/api-client/src/api/user-v1alpha1-public-api.ts delete mode 100644 ui/packages/api-client/src/models/password-reset-email-request.ts delete mode 100644 ui/packages/api-client/src/models/public-key-response.ts delete mode 100644 ui/packages/api-client/src/models/register-verify-email-request.ts delete mode 100644 ui/packages/api-client/src/models/reset-password-request.ts delete mode 100644 ui/packages/api-client/src/models/sign-up-request.ts diff --git a/api-docs/openapi/v3_0/aggregated.json b/api-docs/openapi/v3_0/aggregated.json index c113600923c..bb1dc041a4a 100644 --- a/api-docs/openapi/v3_0/aggregated.json +++ b/api-docs/openapi/v3_0/aggregated.json @@ -6512,123 +6512,6 @@ ] } }, - "/apis/api.halo.run/v1alpha1/users/-/send-password-reset-email": { - "post": { - "description": "Send password reset email when forgot password", - "operationId": "SendPasswordResetEmail", - "requestBody": { - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/PasswordResetEmailRequest" - } - } - }, - "required": true - }, - "responses": { - "204 NO_CONTENT": { - "content": {}, - "description": "default response" - } - }, - "tags": [ - "UserV1alpha1Public" - ] - } - }, - "/apis/api.halo.run/v1alpha1/users/-/send-register-verify-email": { - "post": { - "description": "Send registration verification email, which can be called when mustVerifyEmailOnRegistration in user settings is true", - "operationId": "SendRegisterVerifyEmail", - "requestBody": { - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/RegisterVerifyEmailRequest" - } - } - }, - "required": true - }, - "responses": { - "204 NO_CONTENT": { - "content": {}, - "description": "default response" - } - }, - "tags": [ - "UserV1alpha1Public" - ] - } - }, - "/apis/api.halo.run/v1alpha1/users/-/signup": { - "post": { - "description": "Sign up a new user", - "operationId": "SignUp", - "requestBody": { - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/SignUpRequest" - } - } - }, - "required": true - }, - "responses": { - "default": { - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/User" - } - } - }, - "description": "default response" - } - }, - "tags": [ - "UserV1alpha1Public" - ] - } - }, - "/apis/api.halo.run/v1alpha1/users/{name}/reset-password": { - "put": { - "description": "Reset password by token", - "operationId": "ResetPasswordByToken", - "parameters": [ - { - "description": "The name of the user", - "in": "path", - "name": "name", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/ResetPasswordRequest" - } - } - }, - "required": true - }, - "responses": { - "204 NO_CONTENT": { - "content": {}, - "description": "default response" - } - }, - "tags": [ - "UserV1alpha1Public" - ] - } - }, "/apis/api.notification.halo.run/v1alpha1/notifiers/{name}/receiver-config": { "get": { "description": "Fetch receiver config of notifier", @@ -15655,27 +15538,6 @@ "PersonalAccessTokenV1alpha1Uc" ] } - }, - "/login/public-key": { - "get": { - "description": "Read public key for encrypting password.", - "operationId": "GetPublicKey", - "responses": { - "default": { - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/PublicKeyResponse" - } - } - }, - "description": "default response" - } - }, - "tags": [ - "Login" - ] - } } }, "components": { @@ -16036,6 +15898,13 @@ ], "type": "object", "properties": { + "authType": { + "type": "string", + "enum": [ + "FORM", + "OAUTH2" + ] + }, "authenticationUrl": { "type": "string", "description": "Authentication url of the auth provider" @@ -16059,10 +15928,16 @@ "logo": { "type": "string" }, + "method": { + "type": "string" + }, "priority": { "type": "integer", "format": "int32" }, + "rememberMeSupport": { + "type": "boolean" + }, "settingRef": { "$ref": "#/components/schemas/SettingRef" }, @@ -19844,21 +19719,6 @@ } } }, - "PasswordResetEmailRequest": { - "required": [ - "email", - "username" - ], - "type": "object", - "properties": { - "email": { - "type": "string" - }, - "username": { - "type": "string" - } - } - }, "PatSpec": { "required": [ "name", @@ -20792,14 +20652,6 @@ } } }, - "PublicKeyResponse": { - "type": "object", - "properties": { - "base64Format": { - "type": "string" - } - } - }, "Reason": { "required": [ "apiVersion", @@ -21184,17 +21036,6 @@ }, "description": "Extension reference object. The name is mandatory" }, - "RegisterVerifyEmailRequest": { - "required": [ - "email" - ], - "type": "object", - "properties": { - "email": { - "type": "string" - } - } - }, "RememberMeToken": { "required": [ "apiVersion", @@ -21623,22 +21464,6 @@ } } }, - "ResetPasswordRequest": { - "required": [ - "newPassword", - "token" - ], - "type": "object", - "properties": { - "newPassword": { - "minLength": 6, - "type": "string" - }, - "token": { - "type": "string" - } - } - }, "RestoreRequest": { "type": "object", "properties": { @@ -22391,27 +22216,6 @@ } } }, - "SignUpRequest": { - "required": [ - "password", - "user" - ], - "type": "object", - "properties": { - "password": { - "minLength": 6, - "type": "string" - }, - "user": { - "$ref": "#/components/schemas/User" - }, - "verifyCode": { - "maxLength": 6, - "minLength": 6, - "type": "string" - } - } - }, "SinglePage": { "required": [ "apiVersion", diff --git a/api-docs/openapi/v3_0/apis_console.api_v1alpha1.json b/api-docs/openapi/v3_0/apis_console.api_v1alpha1.json index 691189a058b..8f2e91c2cbf 100644 --- a/api-docs/openapi/v3_0/apis_console.api_v1alpha1.json +++ b/api-docs/openapi/v3_0/apis_console.api_v1alpha1.json @@ -3629,6 +3629,13 @@ ], "type": "object", "properties": { + "authType": { + "type": "string", + "enum": [ + "FORM", + "OAUTH2" + ] + }, "authenticationUrl": { "type": "string", "description": "Authentication url of the auth provider" @@ -3652,10 +3659,16 @@ "logo": { "type": "string" }, + "method": { + "type": "string" + }, "priority": { "type": "integer", "format": "int32" }, + "rememberMeSupport": { + "type": "boolean" + }, "settingRef": { "$ref": "#/components/schemas/SettingRef" }, diff --git a/api-docs/openapi/v3_0/apis_extension.api_v1alpha1.json b/api-docs/openapi/v3_0/apis_extension.api_v1alpha1.json index 342a5684a01..da959400393 100644 --- a/api-docs/openapi/v3_0/apis_extension.api_v1alpha1.json +++ b/api-docs/openapi/v3_0/apis_extension.api_v1alpha1.json @@ -8671,6 +8671,13 @@ ], "type": "object", "properties": { + "authType": { + "type": "string", + "enum": [ + "FORM", + "OAUTH2" + ] + }, "authenticationUrl": { "type": "string", "description": "Authentication url of the auth provider" @@ -8694,10 +8701,16 @@ "logo": { "type": "string" }, + "method": { + "type": "string" + }, "priority": { "type": "integer", "format": "int32" }, + "rememberMeSupport": { + "type": "boolean" + }, "settingRef": { "$ref": "#/components/schemas/SettingRef" }, diff --git a/api-docs/openapi/v3_0/apis_public.api_v1alpha1.json b/api-docs/openapi/v3_0/apis_public.api_v1alpha1.json index daa70428a14..2572b1c21be 100644 --- a/api-docs/openapi/v3_0/apis_public.api_v1alpha1.json +++ b/api-docs/openapi/v3_0/apis_public.api_v1alpha1.json @@ -506,123 +506,6 @@ "MetricsV1alpha1Public" ] } - }, - "/apis/api.halo.run/v1alpha1/users/-/send-password-reset-email": { - "post": { - "description": "Send password reset email when forgot password", - "operationId": "SendPasswordResetEmail", - "requestBody": { - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/PasswordResetEmailRequest" - } - } - }, - "required": true - }, - "responses": { - "204 NO_CONTENT": { - "content": {}, - "description": "default response" - } - }, - "tags": [ - "UserV1alpha1Public" - ] - } - }, - "/apis/api.halo.run/v1alpha1/users/-/send-register-verify-email": { - "post": { - "description": "Send registration verification email, which can be called when mustVerifyEmailOnRegistration in user settings is true", - "operationId": "SendRegisterVerifyEmail", - "requestBody": { - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/RegisterVerifyEmailRequest" - } - } - }, - "required": true - }, - "responses": { - "204 NO_CONTENT": { - "content": {}, - "description": "default response" - } - }, - "tags": [ - "UserV1alpha1Public" - ] - } - }, - "/apis/api.halo.run/v1alpha1/users/-/signup": { - "post": { - "description": "Sign up a new user", - "operationId": "SignUp", - "requestBody": { - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/SignUpRequest" - } - } - }, - "required": true - }, - "responses": { - "default": { - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/User" - } - } - }, - "description": "default response" - } - }, - "tags": [ - "UserV1alpha1Public" - ] - } - }, - "/apis/api.halo.run/v1alpha1/users/{name}/reset-password": { - "put": { - "description": "Reset password by token", - "operationId": "ResetPasswordByToken", - "parameters": [ - { - "description": "The name of the user", - "in": "path", - "name": "name", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/ResetPasswordRequest" - } - } - }, - "required": true - }, - "responses": { - "204 NO_CONTENT": { - "content": {}, - "description": "default response" - } - }, - "tags": [ - "UserV1alpha1Public" - ] - } } }, "components": { @@ -1244,33 +1127,6 @@ } } }, - "LoginHistory": { - "required": [ - "loginAt", - "sourceIp", - "successful", - "userAgent" - ], - "type": "object", - "properties": { - "loginAt": { - "type": "string", - "format": "date-time" - }, - "reason": { - "type": "string" - }, - "sourceIp": { - "type": "string" - }, - "successful": { - "type": "boolean" - }, - "userAgent": { - "type": "string" - } - } - }, "MenuItemSpec": { "type": "object", "properties": { @@ -1488,21 +1344,6 @@ } } }, - "PasswordResetEmailRequest": { - "required": [ - "email", - "username" - ], - "type": "object", - "properties": { - "email": { - "type": "string" - }, - "username": { - "type": "string" - } - } - }, "Ref": { "required": [ "name" @@ -1528,17 +1369,6 @@ }, "description": "Extension reference object. The name is mandatory" }, - "RegisterVerifyEmailRequest": { - "required": [ - "email" - ], - "type": "object", - "properties": { - "email": { - "type": "string" - } - } - }, "RemoveOperation": { "required": [ "op", @@ -1800,22 +1630,6 @@ } } }, - "ResetPasswordRequest": { - "required": [ - "newPassword", - "token" - ], - "type": "object", - "properties": { - "newPassword": { - "minLength": 6, - "type": "string" - }, - "token": { - "type": "string" - } - } - }, "SearchOption": { "required": [ "keyword" @@ -1904,27 +1718,6 @@ } } }, - "SignUpRequest": { - "required": [ - "password", - "user" - ], - "type": "object", - "properties": { - "password": { - "minLength": 6, - "type": "string" - }, - "user": { - "$ref": "#/components/schemas/User" - }, - "verifyCode": { - "maxLength": 6, - "minLength": 6, - "type": "string" - } - } - }, "SiteStatsVo": { "type": "object", "properties": { @@ -1975,97 +1768,6 @@ } } }, - "User": { - "required": [ - "apiVersion", - "kind", - "metadata", - "spec" - ], - "type": "object", - "properties": { - "apiVersion": { - "type": "string" - }, - "kind": { - "type": "string" - }, - "metadata": { - "$ref": "#/components/schemas/Metadata" - }, - "spec": { - "$ref": "#/components/schemas/UserSpec" - }, - "status": { - "$ref": "#/components/schemas/UserStatus" - } - } - }, - "UserSpec": { - "required": [ - "displayName", - "email" - ], - "type": "object", - "properties": { - "avatar": { - "type": "string" - }, - "bio": { - "type": "string" - }, - "disabled": { - "type": "boolean" - }, - "displayName": { - "type": "string" - }, - "email": { - "type": "string" - }, - "emailVerified": { - "type": "boolean" - }, - "loginHistoryLimit": { - "type": "integer", - "format": "int32" - }, - "password": { - "type": "string" - }, - "phone": { - "type": "string" - }, - "registeredAt": { - "type": "string", - "format": "date-time" - }, - "totpEncryptedSecret": { - "type": "string" - }, - "twoFactorAuthEnabled": { - "type": "boolean" - } - } - }, - "UserStatus": { - "type": "object", - "properties": { - "lastLoginAt": { - "type": "string", - "format": "date-time" - }, - "loginHistories": { - "type": "array", - "items": { - "$ref": "#/components/schemas/LoginHistory" - } - }, - "permalink": { - "type": "string" - } - } - }, "VoteRequest": { "type": "object", "properties": { diff --git a/ui/packages/api-client/entry/api-client.ts b/ui/packages/api-client/entry/api-client.ts index 917a2bc0fda..4cae6d04360 100644 --- a/ui/packages/api-client/entry/api-client.ts +++ b/ui/packages/api-client/entry/api-client.ts @@ -19,7 +19,6 @@ import { ExtensionPointDefinitionV1alpha1Api, GroupV1alpha1Api, IndicesV1alpha1ConsoleApi, - LoginApi, MenuItemV1alpha1Api, MenuV1alpha1Api, MenuV1alpha1PublicApi, @@ -66,7 +65,6 @@ import { UserConnectionV1alpha1Api, UserV1alpha1Api, UserV1alpha1ConsoleApi, - UserV1alpha1PublicApi, } from "../src"; const defaultAxiosInstance = axios.create({ @@ -281,7 +279,6 @@ function createConsoleApiClient(axiosInstance: AxiosInstance) { baseURL, axiosInstance ), - login: new LoginApi(undefined, baseURL, axiosInstance), storage: { attachment: new AttachmentV1alpha1ConsoleApi( undefined, @@ -431,7 +428,6 @@ function createPublicApiClient(axiosInstance: AxiosInstance) { return { menu: new MenuV1alpha1PublicApi(undefined, baseURL, axiosInstance), stats: new SystemV1alpha1PublicApi(undefined, baseURL, axiosInstance), - user: new UserV1alpha1PublicApi(undefined, baseURL, axiosInstance), content: { post: new PostV1alpha1PublicApi(undefined, baseURL, axiosInstance), comment: new CommentV1alpha1PublicApi(undefined, baseURL, axiosInstance), diff --git a/ui/packages/api-client/src/.openapi-generator/FILES b/ui/packages/api-client/src/.openapi-generator/FILES index ef20b505ae3..fe7e5a16eba 100644 --- a/ui/packages/api-client/src/.openapi-generator/FILES +++ b/ui/packages/api-client/src/.openapi-generator/FILES @@ -25,7 +25,6 @@ api/group-v1alpha1-api.ts api/index-v1alpha1-public-api.ts api/indices-v1alpha1-console-api.ts api/local-thumbnail-v1alpha1-api.ts -api/login-api.ts api/menu-item-v1alpha1-api.ts api/menu-v1alpha1-api.ts api/menu-v1alpha1-public-api.ts @@ -79,7 +78,6 @@ api/two-factor-auth-v1alpha1-uc-api.ts api/user-connection-v1alpha1-api.ts api/user-v1alpha1-api.ts api/user-v1alpha1-console-api.ts -api/user-v1alpha1-public-api.ts base.ts common.ts configuration.ts @@ -217,7 +215,6 @@ models/notifier-info.ts models/notifier-setting-ref.ts models/owner-info.ts models/password-request.ts -models/password-reset-email-request.ts models/pat-spec.ts models/personal-access-token-list.ts models/personal-access-token.ts @@ -240,7 +237,6 @@ models/post-spec.ts models/post-status.ts models/post-vo.ts models/post.ts -models/public-key-response.ts models/reason-attributes.ts models/reason-list.ts models/reason-property.ts @@ -256,7 +252,6 @@ models/reason-type-spec.ts models/reason-type.ts models/reason.ts models/ref.ts -models/register-verify-email-request.ts models/remember-me-token-list.ts models/remember-me-token-spec.ts models/remember-me-token.ts @@ -269,7 +264,6 @@ models/reply-status.ts models/reply-vo-list.ts models/reply-vo.ts models/reply.ts -models/reset-password-request.ts models/reverse-proxy-list.ts models/reverse-proxy-rule.ts models/reverse-proxy.ts @@ -292,7 +286,6 @@ models/setting-list.ts models/setting-ref.ts models/setting-spec.ts models/setting.ts -models/sign-up-request.ts models/single-page-list.ts models/single-page-request.ts models/single-page-spec.ts diff --git a/ui/packages/api-client/src/api.ts b/ui/packages/api-client/src/api.ts index 77ff213779f..37b68fa2182 100644 --- a/ui/packages/api-client/src/api.ts +++ b/ui/packages/api-client/src/api.ts @@ -37,7 +37,6 @@ export * from './api/group-v1alpha1-api'; export * from './api/index-v1alpha1-public-api'; export * from './api/indices-v1alpha1-console-api'; export * from './api/local-thumbnail-v1alpha1-api'; -export * from './api/login-api'; export * from './api/menu-item-v1alpha1-api'; export * from './api/menu-v1alpha1-api'; export * from './api/menu-v1alpha1-public-api'; @@ -91,5 +90,4 @@ export * from './api/two-factor-auth-v1alpha1-uc-api'; export * from './api/user-connection-v1alpha1-api'; export * from './api/user-v1alpha1-api'; export * from './api/user-v1alpha1-console-api'; -export * from './api/user-v1alpha1-public-api'; diff --git a/ui/packages/api-client/src/api/login-api.ts b/ui/packages/api-client/src/api/login-api.ts deleted file mode 100644 index ad409be6b9b..00000000000 --- a/ui/packages/api-client/src/api/login-api.ts +++ /dev/null @@ -1,128 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Halo - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 2.20.0-SNAPSHOT - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; -import globalAxios from 'axios'; -// Some imports not used depending on template conditions -// @ts-ignore -import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; -// @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; -// @ts-ignore -import { PublicKeyResponse } from '../models'; -/** - * LoginApi - axios parameter creator - * @export - */ -export const LoginApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * Read public key for encrypting password. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getPublicKey: async (options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/login/public-key`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - // authentication bearerAuth required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * LoginApi - functional programming interface - * @export - */ -export const LoginApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = LoginApiAxiosParamCreator(configuration) - return { - /** - * Read public key for encrypting password. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getPublicKey(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getPublicKey(options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['LoginApi.getPublicKey']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } -}; - -/** - * LoginApi - factory interface - * @export - */ -export const LoginApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = LoginApiFp(configuration) - return { - /** - * Read public key for encrypting password. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getPublicKey(options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getPublicKey(options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * LoginApi - object-oriented interface - * @export - * @class LoginApi - * @extends {BaseAPI} - */ -export class LoginApi extends BaseAPI { - /** - * Read public key for encrypting password. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof LoginApi - */ - public getPublicKey(options?: RawAxiosRequestConfig) { - return LoginApiFp(this.configuration).getPublicKey(options).then((request) => request(this.axios, this.basePath)); - } -} - diff --git a/ui/packages/api-client/src/api/user-v1alpha1-public-api.ts b/ui/packages/api-client/src/api/user-v1alpha1-public-api.ts deleted file mode 100644 index ed77275cd95..00000000000 --- a/ui/packages/api-client/src/api/user-v1alpha1-public-api.ts +++ /dev/null @@ -1,438 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Halo - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 2.20.0-SNAPSHOT - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; -import globalAxios from 'axios'; -// Some imports not used depending on template conditions -// @ts-ignore -import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; -// @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; -// @ts-ignore -import { PasswordResetEmailRequest } from '../models'; -// @ts-ignore -import { RegisterVerifyEmailRequest } from '../models'; -// @ts-ignore -import { ResetPasswordRequest } from '../models'; -// @ts-ignore -import { SignUpRequest } from '../models'; -// @ts-ignore -import { User } from '../models'; -/** - * UserV1alpha1PublicApi - axios parameter creator - * @export - */ -export const UserV1alpha1PublicApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * Reset password by token - * @param {string} name The name of the user - * @param {ResetPasswordRequest} resetPasswordRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - resetPasswordByToken: async (name: string, resetPasswordRequest: ResetPasswordRequest, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'name' is not null or undefined - assertParamExists('resetPasswordByToken', 'name', name) - // verify required parameter 'resetPasswordRequest' is not null or undefined - assertParamExists('resetPasswordByToken', 'resetPasswordRequest', resetPasswordRequest) - const localVarPath = `/apis/api.halo.run/v1alpha1/users/{name}/reset-password` - .replace(`{${"name"}}`, encodeURIComponent(String(name))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - // authentication bearerAuth required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(resetPasswordRequest, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Send password reset email when forgot password - * @param {PasswordResetEmailRequest} passwordResetEmailRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - sendPasswordResetEmail: async (passwordResetEmailRequest: PasswordResetEmailRequest, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'passwordResetEmailRequest' is not null or undefined - assertParamExists('sendPasswordResetEmail', 'passwordResetEmailRequest', passwordResetEmailRequest) - const localVarPath = `/apis/api.halo.run/v1alpha1/users/-/send-password-reset-email`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - // authentication bearerAuth required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(passwordResetEmailRequest, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Send registration verification email, which can be called when mustVerifyEmailOnRegistration in user settings is true - * @param {RegisterVerifyEmailRequest} registerVerifyEmailRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - sendRegisterVerifyEmail: async (registerVerifyEmailRequest: RegisterVerifyEmailRequest, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'registerVerifyEmailRequest' is not null or undefined - assertParamExists('sendRegisterVerifyEmail', 'registerVerifyEmailRequest', registerVerifyEmailRequest) - const localVarPath = `/apis/api.halo.run/v1alpha1/users/-/send-register-verify-email`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - // authentication bearerAuth required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(registerVerifyEmailRequest, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Sign up a new user - * @param {SignUpRequest} signUpRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - signUp: async (signUpRequest: SignUpRequest, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'signUpRequest' is not null or undefined - assertParamExists('signUp', 'signUpRequest', signUpRequest) - const localVarPath = `/apis/api.halo.run/v1alpha1/users/-/signup`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - // authentication bearerAuth required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(signUpRequest, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * UserV1alpha1PublicApi - functional programming interface - * @export - */ -export const UserV1alpha1PublicApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = UserV1alpha1PublicApiAxiosParamCreator(configuration) - return { - /** - * Reset password by token - * @param {string} name The name of the user - * @param {ResetPasswordRequest} resetPasswordRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async resetPasswordByToken(name: string, resetPasswordRequest: ResetPasswordRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.resetPasswordByToken(name, resetPasswordRequest, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['UserV1alpha1PublicApi.resetPasswordByToken']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Send password reset email when forgot password - * @param {PasswordResetEmailRequest} passwordResetEmailRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async sendPasswordResetEmail(passwordResetEmailRequest: PasswordResetEmailRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.sendPasswordResetEmail(passwordResetEmailRequest, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['UserV1alpha1PublicApi.sendPasswordResetEmail']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Send registration verification email, which can be called when mustVerifyEmailOnRegistration in user settings is true - * @param {RegisterVerifyEmailRequest} registerVerifyEmailRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async sendRegisterVerifyEmail(registerVerifyEmailRequest: RegisterVerifyEmailRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.sendRegisterVerifyEmail(registerVerifyEmailRequest, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['UserV1alpha1PublicApi.sendRegisterVerifyEmail']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Sign up a new user - * @param {SignUpRequest} signUpRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async signUp(signUpRequest: SignUpRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.signUp(signUpRequest, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['UserV1alpha1PublicApi.signUp']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } -}; - -/** - * UserV1alpha1PublicApi - factory interface - * @export - */ -export const UserV1alpha1PublicApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = UserV1alpha1PublicApiFp(configuration) - return { - /** - * Reset password by token - * @param {UserV1alpha1PublicApiResetPasswordByTokenRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - resetPasswordByToken(requestParameters: UserV1alpha1PublicApiResetPasswordByTokenRequest, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.resetPasswordByToken(requestParameters.name, requestParameters.resetPasswordRequest, options).then((request) => request(axios, basePath)); - }, - /** - * Send password reset email when forgot password - * @param {UserV1alpha1PublicApiSendPasswordResetEmailRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - sendPasswordResetEmail(requestParameters: UserV1alpha1PublicApiSendPasswordResetEmailRequest, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.sendPasswordResetEmail(requestParameters.passwordResetEmailRequest, options).then((request) => request(axios, basePath)); - }, - /** - * Send registration verification email, which can be called when mustVerifyEmailOnRegistration in user settings is true - * @param {UserV1alpha1PublicApiSendRegisterVerifyEmailRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - sendRegisterVerifyEmail(requestParameters: UserV1alpha1PublicApiSendRegisterVerifyEmailRequest, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.sendRegisterVerifyEmail(requestParameters.registerVerifyEmailRequest, options).then((request) => request(axios, basePath)); - }, - /** - * Sign up a new user - * @param {UserV1alpha1PublicApiSignUpRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - signUp(requestParameters: UserV1alpha1PublicApiSignUpRequest, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.signUp(requestParameters.signUpRequest, options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * Request parameters for resetPasswordByToken operation in UserV1alpha1PublicApi. - * @export - * @interface UserV1alpha1PublicApiResetPasswordByTokenRequest - */ -export interface UserV1alpha1PublicApiResetPasswordByTokenRequest { - /** - * The name of the user - * @type {string} - * @memberof UserV1alpha1PublicApiResetPasswordByToken - */ - readonly name: string - - /** - * - * @type {ResetPasswordRequest} - * @memberof UserV1alpha1PublicApiResetPasswordByToken - */ - readonly resetPasswordRequest: ResetPasswordRequest -} - -/** - * Request parameters for sendPasswordResetEmail operation in UserV1alpha1PublicApi. - * @export - * @interface UserV1alpha1PublicApiSendPasswordResetEmailRequest - */ -export interface UserV1alpha1PublicApiSendPasswordResetEmailRequest { - /** - * - * @type {PasswordResetEmailRequest} - * @memberof UserV1alpha1PublicApiSendPasswordResetEmail - */ - readonly passwordResetEmailRequest: PasswordResetEmailRequest -} - -/** - * Request parameters for sendRegisterVerifyEmail operation in UserV1alpha1PublicApi. - * @export - * @interface UserV1alpha1PublicApiSendRegisterVerifyEmailRequest - */ -export interface UserV1alpha1PublicApiSendRegisterVerifyEmailRequest { - /** - * - * @type {RegisterVerifyEmailRequest} - * @memberof UserV1alpha1PublicApiSendRegisterVerifyEmail - */ - readonly registerVerifyEmailRequest: RegisterVerifyEmailRequest -} - -/** - * Request parameters for signUp operation in UserV1alpha1PublicApi. - * @export - * @interface UserV1alpha1PublicApiSignUpRequest - */ -export interface UserV1alpha1PublicApiSignUpRequest { - /** - * - * @type {SignUpRequest} - * @memberof UserV1alpha1PublicApiSignUp - */ - readonly signUpRequest: SignUpRequest -} - -/** - * UserV1alpha1PublicApi - object-oriented interface - * @export - * @class UserV1alpha1PublicApi - * @extends {BaseAPI} - */ -export class UserV1alpha1PublicApi extends BaseAPI { - /** - * Reset password by token - * @param {UserV1alpha1PublicApiResetPasswordByTokenRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof UserV1alpha1PublicApi - */ - public resetPasswordByToken(requestParameters: UserV1alpha1PublicApiResetPasswordByTokenRequest, options?: RawAxiosRequestConfig) { - return UserV1alpha1PublicApiFp(this.configuration).resetPasswordByToken(requestParameters.name, requestParameters.resetPasswordRequest, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Send password reset email when forgot password - * @param {UserV1alpha1PublicApiSendPasswordResetEmailRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof UserV1alpha1PublicApi - */ - public sendPasswordResetEmail(requestParameters: UserV1alpha1PublicApiSendPasswordResetEmailRequest, options?: RawAxiosRequestConfig) { - return UserV1alpha1PublicApiFp(this.configuration).sendPasswordResetEmail(requestParameters.passwordResetEmailRequest, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Send registration verification email, which can be called when mustVerifyEmailOnRegistration in user settings is true - * @param {UserV1alpha1PublicApiSendRegisterVerifyEmailRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof UserV1alpha1PublicApi - */ - public sendRegisterVerifyEmail(requestParameters: UserV1alpha1PublicApiSendRegisterVerifyEmailRequest, options?: RawAxiosRequestConfig) { - return UserV1alpha1PublicApiFp(this.configuration).sendRegisterVerifyEmail(requestParameters.registerVerifyEmailRequest, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Sign up a new user - * @param {UserV1alpha1PublicApiSignUpRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof UserV1alpha1PublicApi - */ - public signUp(requestParameters: UserV1alpha1PublicApiSignUpRequest, options?: RawAxiosRequestConfig) { - return UserV1alpha1PublicApiFp(this.configuration).signUp(requestParameters.signUpRequest, options).then((request) => request(this.axios, this.basePath)); - } -} - diff --git a/ui/packages/api-client/src/models/auth-provider-spec.ts b/ui/packages/api-client/src/models/auth-provider-spec.ts index 0da332c6f32..7933629f017 100644 --- a/ui/packages/api-client/src/models/auth-provider-spec.ts +++ b/ui/packages/api-client/src/models/auth-provider-spec.ts @@ -26,6 +26,12 @@ import { SettingRef } from './setting-ref'; * @interface AuthProviderSpec */ export interface AuthProviderSpec { + /** + * + * @type {string} + * @memberof AuthProviderSpec + */ + 'authType'?: AuthProviderSpecAuthTypeEnum; /** * Authentication url of the auth provider * @type {string} @@ -68,12 +74,24 @@ export interface AuthProviderSpec { * @memberof AuthProviderSpec */ 'logo'?: string; + /** + * + * @type {string} + * @memberof AuthProviderSpec + */ + 'method'?: string; /** * * @type {number} * @memberof AuthProviderSpec */ 'priority'?: number; + /** + * + * @type {boolean} + * @memberof AuthProviderSpec + */ + 'rememberMeSupport'?: boolean; /** * * @type {SettingRef} @@ -94,3 +112,11 @@ export interface AuthProviderSpec { 'website'?: string; } +export const AuthProviderSpecAuthTypeEnum = { + Form: 'FORM', + Oauth2: 'OAUTH2' +} as const; + +export type AuthProviderSpecAuthTypeEnum = typeof AuthProviderSpecAuthTypeEnum[keyof typeof AuthProviderSpecAuthTypeEnum]; + + diff --git a/ui/packages/api-client/src/models/index.ts b/ui/packages/api-client/src/models/index.ts index d6c4372ece2..cd721814af5 100644 --- a/ui/packages/api-client/src/models/index.ts +++ b/ui/packages/api-client/src/models/index.ts @@ -129,7 +129,6 @@ export * from './notifier-info'; export * from './notifier-setting-ref'; export * from './owner-info'; export * from './password-request'; -export * from './password-reset-email-request'; export * from './pat-spec'; export * from './personal-access-token'; export * from './personal-access-token-list'; @@ -152,7 +151,6 @@ export * from './post-request'; export * from './post-spec'; export * from './post-status'; export * from './post-vo'; -export * from './public-key-response'; export * from './reason'; export * from './reason-attributes'; export * from './reason-list'; @@ -168,7 +166,6 @@ export * from './reason-type-notifier-matrix'; export * from './reason-type-notifier-request'; export * from './reason-type-spec'; export * from './ref'; -export * from './register-verify-email-request'; export * from './remember-me-token'; export * from './remember-me-token-list'; export * from './remember-me-token-spec'; @@ -181,7 +178,6 @@ export * from './reply-spec'; export * from './reply-status'; export * from './reply-vo'; export * from './reply-vo-list'; -export * from './reset-password-request'; export * from './reverse-proxy'; export * from './reverse-proxy-list'; export * from './reverse-proxy-rule'; @@ -204,7 +200,6 @@ export * from './setting-form'; export * from './setting-list'; export * from './setting-ref'; export * from './setting-spec'; -export * from './sign-up-request'; export * from './single-page'; export * from './single-page-list'; export * from './single-page-request'; diff --git a/ui/packages/api-client/src/models/password-reset-email-request.ts b/ui/packages/api-client/src/models/password-reset-email-request.ts deleted file mode 100644 index d6aedbe2467..00000000000 --- a/ui/packages/api-client/src/models/password-reset-email-request.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Halo - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 2.20.0-SNAPSHOT - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - - -/** - * - * @export - * @interface PasswordResetEmailRequest - */ -export interface PasswordResetEmailRequest { - /** - * - * @type {string} - * @memberof PasswordResetEmailRequest - */ - 'email': string; - /** - * - * @type {string} - * @memberof PasswordResetEmailRequest - */ - 'username': string; -} - diff --git a/ui/packages/api-client/src/models/public-key-response.ts b/ui/packages/api-client/src/models/public-key-response.ts deleted file mode 100644 index 1829449314a..00000000000 --- a/ui/packages/api-client/src/models/public-key-response.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Halo - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 2.20.0-SNAPSHOT - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - - -/** - * - * @export - * @interface PublicKeyResponse - */ -export interface PublicKeyResponse { - /** - * - * @type {string} - * @memberof PublicKeyResponse - */ - 'base64Format'?: string; -} - diff --git a/ui/packages/api-client/src/models/register-verify-email-request.ts b/ui/packages/api-client/src/models/register-verify-email-request.ts deleted file mode 100644 index 19f4e0ff207..00000000000 --- a/ui/packages/api-client/src/models/register-verify-email-request.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Halo - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 2.20.0-SNAPSHOT - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - - -/** - * - * @export - * @interface RegisterVerifyEmailRequest - */ -export interface RegisterVerifyEmailRequest { - /** - * - * @type {string} - * @memberof RegisterVerifyEmailRequest - */ - 'email': string; -} - diff --git a/ui/packages/api-client/src/models/reset-password-request.ts b/ui/packages/api-client/src/models/reset-password-request.ts deleted file mode 100644 index ebe725ef6f3..00000000000 --- a/ui/packages/api-client/src/models/reset-password-request.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Halo - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 2.20.0-SNAPSHOT - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - - -/** - * - * @export - * @interface ResetPasswordRequest - */ -export interface ResetPasswordRequest { - /** - * - * @type {string} - * @memberof ResetPasswordRequest - */ - 'newPassword': string; - /** - * - * @type {string} - * @memberof ResetPasswordRequest - */ - 'token': string; -} - diff --git a/ui/packages/api-client/src/models/sign-up-request.ts b/ui/packages/api-client/src/models/sign-up-request.ts deleted file mode 100644 index 6db669e86a0..00000000000 --- a/ui/packages/api-client/src/models/sign-up-request.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Halo - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 2.20.0-SNAPSHOT - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -// May contain unused imports in some cases -// @ts-ignore -import { User } from './user'; - -/** - * - * @export - * @interface SignUpRequest - */ -export interface SignUpRequest { - /** - * - * @type {string} - * @memberof SignUpRequest - */ - 'password': string; - /** - * - * @type {User} - * @memberof SignUpRequest - */ - 'user': User; - /** - * - * @type {string} - * @memberof SignUpRequest - */ - 'verifyCode'?: string; -} - From 1947a544f2597ea62011db9572d6c5273f9e921d Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Sun, 29 Sep 2024 16:15:46 +0800 Subject: [PATCH 3/3] feat: refine i18n resources for login-related page (#6726) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### What type of PR is this? /area core /kind improvement /milestone 2.20.x #### What this PR does / why we need it: 完善新登录相关页面的多语言资源文件。 #### Which issue(s) this PR fixes: Fixes https://github.com/halo-dev/halo/issues/6721 #### Does this PR introduce a user-facing change? ```release-note None ``` --- .../src/main/resources/static/js/main.js | 5 +- .../challenges/two-factor/totp.properties | 2 +- .../challenges/two-factor/totp_es.properties | 4 + .../two-factor/totp_zh_TW.properties | 4 + .../gateway_modules/common_fragments.html | 16 +- .../common_fragments.properties | 4 +- .../common_fragments_en.properties | 4 +- .../common_fragments_es.properties | 3 + .../common_fragments_zh_TW.properties | 3 + .../login_fragments_en.properties | 2 +- .../login_fragments_es.properties | 13 + .../login_fragments_zh_TW.properties | 13 + .../resources/templates/login_es.properties | 1 + .../templates/login_local_es.properties | 3 + .../templates/login_local_zh_TW.properties | 3 + .../templates/login_zh_TW.properties | 1 + .../resources/templates/logout_es.properties | 3 + .../templates/logout_zh_TW.properties | 3 + .../templates/password-reset-link.html | 4 +- .../password-reset-link_es.properties | 5 + .../password-reset-link_zh_TW.properties | 5 + .../resources/templates/password-reset.html | 4 +- .../templates/password-reset_es.properties | 6 + .../templates/password-reset_zh_TW.properties | 6 + .../src/main/resources/templates/signup.html | 284 +++++++++--------- .../resources/templates/signup.properties | 3 +- .../resources/templates/signup_en.properties | 15 +- .../resources/templates/signup_es.properties | 14 + .../templates/signup_zh_TW.properties | 14 + 29 files changed, 289 insertions(+), 158 deletions(-) create mode 100644 application/src/main/resources/templates/challenges/two-factor/totp_es.properties create mode 100644 application/src/main/resources/templates/challenges/two-factor/totp_zh_TW.properties create mode 100644 application/src/main/resources/templates/gateway_modules/common_fragments_es.properties create mode 100644 application/src/main/resources/templates/gateway_modules/common_fragments_zh_TW.properties create mode 100644 application/src/main/resources/templates/gateway_modules/login_fragments_es.properties create mode 100644 application/src/main/resources/templates/gateway_modules/login_fragments_zh_TW.properties create mode 100644 application/src/main/resources/templates/login_es.properties create mode 100644 application/src/main/resources/templates/login_local_es.properties create mode 100644 application/src/main/resources/templates/login_local_zh_TW.properties create mode 100644 application/src/main/resources/templates/login_zh_TW.properties create mode 100644 application/src/main/resources/templates/logout_es.properties create mode 100644 application/src/main/resources/templates/logout_zh_TW.properties create mode 100644 application/src/main/resources/templates/password-reset-link_es.properties create mode 100644 application/src/main/resources/templates/password-reset-link_zh_TW.properties create mode 100644 application/src/main/resources/templates/password-reset_es.properties create mode 100644 application/src/main/resources/templates/password-reset_zh_TW.properties create mode 100644 application/src/main/resources/templates/signup_es.properties create mode 100644 application/src/main/resources/templates/signup_zh_TW.properties diff --git a/application/src/main/resources/static/js/main.js b/application/src/main/resources/static/js/main.js index 2db2e606b18..727b25abf47 100644 --- a/application/src/main/resources/static/js/main.js +++ b/application/src/main/resources/static/js/main.js @@ -96,14 +96,14 @@ function sendVerificationCode(button, sendRequest) { sendRequest() .then(() => { startCountdown(); - Toast.success("发送成功"); + Toast.success(i18nResources.sendVerificationCodeSuccess); }) .catch((e) => { button.disabled = false; if (e instanceof Error) { Toast.error(e.message); } else { - Toast.error("发送失败,请稍后再试"); + Toast.error(i18nResources.sendVerificationCodeFailed); } }); }); @@ -151,4 +151,3 @@ document.addEventListener("DOMContentLoaded", () => { } }); }); - diff --git a/application/src/main/resources/templates/challenges/two-factor/totp.properties b/application/src/main/resources/templates/challenges/two-factor/totp.properties index 46f96ed9781..dfea51a906e 100644 --- a/application/src/main/resources/templates/challenges/two-factor/totp.properties +++ b/application/src/main/resources/templates/challenges/two-factor/totp.properties @@ -1,4 +1,4 @@ title=两步验证 messages.invalidError=错误的验证码 form.code.label=验证码 -form.submit=验证 +form.submit=验证 \ No newline at end of file diff --git a/application/src/main/resources/templates/challenges/two-factor/totp_es.properties b/application/src/main/resources/templates/challenges/two-factor/totp_es.properties new file mode 100644 index 00000000000..43e5e25e1ce --- /dev/null +++ b/application/src/main/resources/templates/challenges/two-factor/totp_es.properties @@ -0,0 +1,4 @@ +title=Autenticación en Dos Pasos +messages.invalidError=Código de verificación incorrecto +form.code.label=Código de Verificación +form.submit=Verificar \ No newline at end of file diff --git a/application/src/main/resources/templates/challenges/two-factor/totp_zh_TW.properties b/application/src/main/resources/templates/challenges/two-factor/totp_zh_TW.properties new file mode 100644 index 00000000000..a2be3bc9c4d --- /dev/null +++ b/application/src/main/resources/templates/challenges/two-factor/totp_zh_TW.properties @@ -0,0 +1,4 @@ +title=兩步驗證 +messages.invalidError=錯誤的驗證碼 +form.code.label=驗證碼 +form.submit=驗證 diff --git a/application/src/main/resources/templates/gateway_modules/common_fragments.html b/application/src/main/resources/templates/gateway_modules/common_fragments.html index 75d718ca33b..dc5df4b1bb2 100644 --- a/application/src/main/resources/templates/gateway_modules/common_fragments.html +++ b/application/src/main/resources/templates/gateway_modules/common_fragments.html @@ -1,13 +1,14 @@ + + + - - - @@ -67,7 +68,10 @@ const selectedLanguage = document.getElementById("language-select").value; const currentURL = new URL(window.location.href); currentURL.searchParams.set("language", selectedLanguage); - window.location.href = currentURL.toString(); + + history.replaceState(null, "", currentURL.toString()); + + window.location.reload(); } diff --git a/application/src/main/resources/templates/gateway_modules/common_fragments.properties b/application/src/main/resources/templates/gateway_modules/common_fragments.properties index 6617dd0d7ba..f079f83e500 100644 --- a/application/src/main/resources/templates/gateway_modules/common_fragments.properties +++ b/application/src/main/resources/templates/gateway_modules/common_fragments.properties @@ -1 +1,3 @@ -socialLogin.label=社交登录 \ No newline at end of file +socialLogin.label=社交登录 +js.sendVerificationCode.success=发送成功 +js.sendVerificationCode.failed=发送失败,请稍后再试 \ No newline at end of file diff --git a/application/src/main/resources/templates/gateway_modules/common_fragments_en.properties b/application/src/main/resources/templates/gateway_modules/common_fragments_en.properties index a10abbb87c3..cb299c93a52 100644 --- a/application/src/main/resources/templates/gateway_modules/common_fragments_en.properties +++ b/application/src/main/resources/templates/gateway_modules/common_fragments_en.properties @@ -1 +1,3 @@ -socialLogin.label=Social Login \ No newline at end of file +socialLogin.label=Social Login +js.sendVerificationCode.success=Sent Successfully +js.sendVerificationCode.failed=Sending Failed, Please Try Again Later \ No newline at end of file diff --git a/application/src/main/resources/templates/gateway_modules/common_fragments_es.properties b/application/src/main/resources/templates/gateway_modules/common_fragments_es.properties new file mode 100644 index 00000000000..cbda753fe49 --- /dev/null +++ b/application/src/main/resources/templates/gateway_modules/common_fragments_es.properties @@ -0,0 +1,3 @@ +socialLogin.label=Inicio de Sesión Social +js.sendVerificationCode.success=Enviado con éxito +js.sendVerificationCode.failed=Error al enviar, por favor intente nuevamente más tarde \ No newline at end of file diff --git a/application/src/main/resources/templates/gateway_modules/common_fragments_zh_TW.properties b/application/src/main/resources/templates/gateway_modules/common_fragments_zh_TW.properties new file mode 100644 index 00000000000..d55ad22de9c --- /dev/null +++ b/application/src/main/resources/templates/gateway_modules/common_fragments_zh_TW.properties @@ -0,0 +1,3 @@ +socialLogin.label=社交登入 +js.sendVerificationCode.success=發送成功 +js.sendVerificationCode.failed=發送失敗,請稍後再試 \ No newline at end of file diff --git a/application/src/main/resources/templates/gateway_modules/login_fragments_en.properties b/application/src/main/resources/templates/gateway_modules/login_fragments_en.properties index d3b5b33f466..90daeec12ba 100644 --- a/application/src/main/resources/templates/gateway_modules/login_fragments_en.properties +++ b/application/src/main/resources/templates/gateway_modules/login_fragments_en.properties @@ -1,6 +1,6 @@ messages.loginError=Invalid credentials. messages.logoutSuccess=Logout successfully. -messages.signupSuccess=Congratulations! Sign up successfully, please sign in now. +messages.signupSuccess=Congratulations! Sign up successfully, please login now. error.invalid-credential=Invalid credentials. error.rate-limit-exceeded=Too many requests, please try again later. diff --git a/application/src/main/resources/templates/gateway_modules/login_fragments_es.properties b/application/src/main/resources/templates/gateway_modules/login_fragments_es.properties new file mode 100644 index 00000000000..ae350b0a6bc --- /dev/null +++ b/application/src/main/resources/templates/gateway_modules/login_fragments_es.properties @@ -0,0 +1,13 @@ +messages.loginError=Credenciales inválidas. +messages.logoutSuccess=Cierre de sesión exitoso. +messages.signupSuccess=¡Felicidades! Registro exitoso, por favor inicie sesión de inmediato. + +error.invalid-credential=Credenciales inválidas. +error.rate-limit-exceeded=Demasiadas solicitudes, por favor intente nuevamente más tarde. + +form.rememberMe.label=Mantener sesión iniciada +form.submit=Iniciar sesión +otherLogin.label=Otras formas de inicio de sesión +signup.description=¿No tienes una cuenta? +signup.link=Regístrate ahora +returnToSite=Volver al sitio diff --git a/application/src/main/resources/templates/gateway_modules/login_fragments_zh_TW.properties b/application/src/main/resources/templates/gateway_modules/login_fragments_zh_TW.properties new file mode 100644 index 00000000000..42fb89cc010 --- /dev/null +++ b/application/src/main/resources/templates/gateway_modules/login_fragments_zh_TW.properties @@ -0,0 +1,13 @@ +messages.loginError=無效的憑證。 +messages.logoutSuccess=登出成功。 +messages.signupSuccess=恭喜!註冊成功,請立即登入。 + +error.invalid-credential=無效的憑證。 +error.rate-limit-exceeded=請求過於頻繁,請稍後再試。 + +form.rememberMe.label=保持登入會話 +form.submit=登入 +otherLogin.label=其他登入方式 +signup.description=沒有帳號? +signup.link=立即註冊 +returnToSite=返回網站 diff --git a/application/src/main/resources/templates/login_es.properties b/application/src/main/resources/templates/login_es.properties new file mode 100644 index 00000000000..44915466c1c --- /dev/null +++ b/application/src/main/resources/templates/login_es.properties @@ -0,0 +1 @@ +title=Iniciar Sesión diff --git a/application/src/main/resources/templates/login_local_es.properties b/application/src/main/resources/templates/login_local_es.properties new file mode 100644 index 00000000000..a13f85b92d5 --- /dev/null +++ b/application/src/main/resources/templates/login_local_es.properties @@ -0,0 +1,3 @@ +form.username.label=Nombre de Usuario +form.password.label=Contraseña +form.password.forgot=¿Olvidaste tu contraseña? diff --git a/application/src/main/resources/templates/login_local_zh_TW.properties b/application/src/main/resources/templates/login_local_zh_TW.properties new file mode 100644 index 00000000000..83af5dba381 --- /dev/null +++ b/application/src/main/resources/templates/login_local_zh_TW.properties @@ -0,0 +1,3 @@ +form.username.label=使用者名稱 +form.password.label=密碼 +form.password.forgot=忘記密碼? \ No newline at end of file diff --git a/application/src/main/resources/templates/login_zh_TW.properties b/application/src/main/resources/templates/login_zh_TW.properties new file mode 100644 index 00000000000..9f1b2d337b5 --- /dev/null +++ b/application/src/main/resources/templates/login_zh_TW.properties @@ -0,0 +1 @@ +title=登入 diff --git a/application/src/main/resources/templates/logout_es.properties b/application/src/main/resources/templates/logout_es.properties new file mode 100644 index 00000000000..ab74ddb0565 --- /dev/null +++ b/application/src/main/resources/templates/logout_es.properties @@ -0,0 +1,3 @@ +title=Cerrar Sesión +form.title=¿Estás seguro de que deseas cerrar sesión? +form.submit=Cerrar Sesión diff --git a/application/src/main/resources/templates/logout_zh_TW.properties b/application/src/main/resources/templates/logout_zh_TW.properties new file mode 100644 index 00000000000..8d8fddf0930 --- /dev/null +++ b/application/src/main/resources/templates/logout_zh_TW.properties @@ -0,0 +1,3 @@ +title=退出登入 +form.title=確定要退出登入嗎? +form.submit=退出登入 diff --git a/application/src/main/resources/templates/password-reset-link.html b/application/src/main/resources/templates/password-reset-link.html index 2a40d4d81b4..5ce127ab342 100644 --- a/application/src/main/resources/templates/password-reset-link.html +++ b/application/src/main/resources/templates/password-reset-link.html @@ -34,6 +34,8 @@

+ +
- \ No newline at end of file + diff --git a/application/src/main/resources/templates/password-reset-link_es.properties b/application/src/main/resources/templates/password-reset-link_es.properties new file mode 100644 index 00000000000..406600dace7 --- /dev/null +++ b/application/src/main/resources/templates/password-reset-link_es.properties @@ -0,0 +1,5 @@ +title=Cambiar Contraseña para {0} +form.password.label=Contraseña +form.confirmPassword.label=Confirmar Contraseña +form.password.tips=La contraseña debe tener al menos 8 caracteres e incluir al menos una letra mayúscula, una letra minúscula, un número y un carácter especial. +form.submit=Cambiar Contraseña diff --git a/application/src/main/resources/templates/password-reset-link_zh_TW.properties b/application/src/main/resources/templates/password-reset-link_zh_TW.properties new file mode 100644 index 00000000000..6b6a4c5bcd5 --- /dev/null +++ b/application/src/main/resources/templates/password-reset-link_zh_TW.properties @@ -0,0 +1,5 @@ +title=為 {0} 修改密碼 +form.password.label=密碼 +form.confirmPassword.label=確認密碼 +form.password.tips=密碼必須至少包含 8 個字元,並且至少包含一個大寫字母、一個小寫字母、一個數字和一個特殊字元。 +form.submit=修改密碼 diff --git a/application/src/main/resources/templates/password-reset.html b/application/src/main/resources/templates/password-reset.html index 3e198e14278..782a9a3a34b 100644 --- a/application/src/main/resources/templates/password-reset.html +++ b/application/src/main/resources/templates/password-reset.html @@ -31,6 +31,8 @@

+ +
- + \ No newline at end of file diff --git a/application/src/main/resources/templates/password-reset_es.properties b/application/src/main/resources/templates/password-reset_es.properties new file mode 100644 index 00000000000..671e3e29e2f --- /dev/null +++ b/application/src/main/resources/templates/password-reset_es.properties @@ -0,0 +1,6 @@ +title=Restablecer Contraseña +form.email.label=Correo Electrónico +form.submit=Enviar +sent.form.submit=Volver a la Página de Inicio de Sesión +sent.form.message=Revisa tu correo electrónico para ver el enlace de restablecimiento de contraseña. Si no aparece en unos minutos, revisa tu carpeta de spam. +sent.title=Correo de Restablecimiento de Contraseña Enviado diff --git a/application/src/main/resources/templates/password-reset_zh_TW.properties b/application/src/main/resources/templates/password-reset_zh_TW.properties new file mode 100644 index 00000000000..9b773cd8938 --- /dev/null +++ b/application/src/main/resources/templates/password-reset_zh_TW.properties @@ -0,0 +1,6 @@ +title=重置密碼 +form.email.label=電子郵件 +form.submit=提交 +sent.form.submit=返回到登入頁面 +sent.form.message=檢查您的電子郵件中是否有重置密碼的連結。如果幾分鐘內沒有出現,請檢查您的垃圾郵件資料夾。 +sent.title=已發送重置密碼的郵件 diff --git a/application/src/main/resources/templates/signup.html b/application/src/main/resources/templates/signup.html index 01186b5ae3e..c1937a2d800 100644 --- a/application/src/main/resources/templates/signup.html +++ b/application/src/main/resources/templates/signup.html @@ -1,36 +1,42 @@ - - - - -