diff --git a/packages/ui/certd-client/src/views/certd/pipeline/cert-upload/use.tsx b/packages/ui/certd-client/src/views/certd/pipeline/cert-upload/use.tsx index 602f2d11a..ac7f6be20 100644 --- a/packages/ui/certd-client/src/views/certd/pipeline/cert-upload/use.tsx +++ b/packages/ui/certd-client/src/views/certd/pipeline/cert-upload/use.tsx @@ -207,7 +207,7 @@ export function useCertUpload() { const { id } = await api.Save({ title: pipeline.title, content: JSON.stringify(pipeline), - keepHistoryCount: 30, + keepHistoryCount: 100, type: "cert_upload", groupId: form.groupId, }); diff --git a/packages/ui/certd-client/src/views/certd/pipeline/certd-form/use.tsx b/packages/ui/certd-client/src/views/certd/pipeline/certd-form/use.tsx index f532c1534..756561a70 100644 --- a/packages/ui/certd-client/src/views/certd/pipeline/certd-form/use.tsx +++ b/packages/ui/certd-client/src/views/certd/pipeline/certd-form/use.tsx @@ -605,7 +605,7 @@ export function useCertPipelineCreator({ formWrapperRef }: { formWrapperRef: Ref const { id } = await api.Save({ title: pipeline.title, content: JSON.stringify(pipeline), - keepHistoryCount: 30, + keepHistoryCount: 100, type: "cert", groupId, addToMonitorEnabled: form.addToMonitorEnabled, diff --git a/packages/ui/certd-client/src/views/certd/pipeline/template/use.tsx b/packages/ui/certd-client/src/views/certd/pipeline/template/use.tsx index 67e3465a7..82283db2b 100644 --- a/packages/ui/certd-client/src/views/certd/pipeline/template/use.tsx +++ b/packages/ui/certd-client/src/views/certd/pipeline/template/use.tsx @@ -160,7 +160,7 @@ export async function createPipelineByTemplate(opts: { templateId: number; title return await templateApi.CreatePipelineByTemplate({ title, content: JSON.stringify(pipeline), - keepHistoryCount: keepHistoryCount ?? 30, + keepHistoryCount: keepHistoryCount ?? 100, groupId, templateId, }); diff --git a/packages/ui/certd-server/src/controller/user/mine/mine-controller.ts b/packages/ui/certd-server/src/controller/user/mine/mine-controller.ts index 25addd26e..301ec9dcd 100644 --- a/packages/ui/certd-server/src/controller/user/mine/mine-controller.ts +++ b/packages/ui/certd-server/src/controller/user/mine/mine-controller.ts @@ -55,16 +55,13 @@ export class MineController extends BaseController { //@ts-ignore user.needInitPassword = needInitPassword; - const { projectId } = await this.getProjectUserIdRead(); - const userProjectQuery = this.accessService.buildUserProjectQuery(userId, projectId); const existingAccess = await this.accessService.findOne({ - where: { type: "acmeAccount", subtype: "letsencrypt", ...userProjectQuery }, + where: { type: "acmeAccount", subtype: "letsencrypt", userId }, }); if (!existingAccess) { //@ts-ignore user.needInitAccount = true; } - return this.ok(user); } diff --git a/packages/ui/certd-server/src/modules/login/service/passkey-service.ts b/packages/ui/certd-server/src/modules/login/service/passkey-service.ts index 740e2b43a..8fa17766b 100644 --- a/packages/ui/certd-server/src/modules/login/service/passkey-service.ts +++ b/packages/ui/certd-server/src/modules/login/service/passkey-service.ts @@ -30,8 +30,8 @@ export class PasskeyService extends BaseService { rpName = siteInfo.title || rpName; } - const rpId = ctx.hostname; - const origin = ctx.origin; + const origin = ctx.headers.origin || ctx.origin; + const rpId = origin ? new URL(origin).hostname : ctx.hostname; return { rpName, diff --git a/packages/ui/certd-server/src/modules/pipeline/service/pipeline-service.ts b/packages/ui/certd-server/src/modules/pipeline/service/pipeline-service.ts index 26bad0575..9d69ba5bd 100644 --- a/packages/ui/certd-server/src/modules/pipeline/service/pipeline-service.ts +++ b/packages/ui/certd-server/src/modules/pipeline/service/pipeline-service.ts @@ -1376,7 +1376,7 @@ export class PipelineService extends BaseService { bean.status = "none"; bean.type = "cert_auto"; bean.disabled = false; - bean.keepHistoryCount = 30; + bean.keepHistoryCount = 100; bean.projectId = req.projectId; await this.save(bean);