mirror of
https://github.com/SECTL/SecScore.git
synced 2026-07-21 11:49:02 +08:00
feat(auth): 实现 OAuth PKCE 安全流程并优化错误处理
添加 PKCE code_verifier 和 code_challenge 支持以增强 OAuth 安全性 重构 OAuth 回调处理逻辑,添加全局锁防止重复处理 优化错误处理和信息打印,增加调试日志 移除不必要的 setTimeout 包装导出功能 格式化代码以提高可读性
This commit is contained in:
@@ -73,7 +73,9 @@ interface BackfillPlanItem {
|
||||
ruleName: string
|
||||
}
|
||||
|
||||
const buildOfflineBackfillPlan = (rules: AutoScoreRule[]): {
|
||||
const buildOfflineBackfillPlan = (
|
||||
rules: AutoScoreRule[]
|
||||
): {
|
||||
items: BackfillPlanItem[]
|
||||
totalRuns: number
|
||||
from: dayjs.Dayjs | null
|
||||
@@ -87,12 +89,15 @@ const buildOfflineBackfillPlan = (rules: AutoScoreRule[]): {
|
||||
|
||||
for (const rule of rules) {
|
||||
if (!rule.enabled) continue
|
||||
const intervalTrigger = rule.triggers.find((trigger) => trigger.event === "interval_time_passed")
|
||||
const intervalTrigger = rule.triggers.find(
|
||||
(trigger) => trigger.event === "interval_time_passed"
|
||||
)
|
||||
if (!intervalTrigger) continue
|
||||
|
||||
const intervalValue = parseIntervalTriggerValue(intervalTrigger.value)
|
||||
if (!intervalValue) continue
|
||||
const intervalMinutes = intervalValue.days * 24 * 60 + intervalValue.hours * 60 + intervalValue.minutes
|
||||
const intervalMinutes =
|
||||
intervalValue.days * 24 * 60 + intervalValue.hours * 60 + intervalValue.minutes
|
||||
if (intervalMinutes <= 0) continue
|
||||
|
||||
const startAt = rule.execution?.startAt ? dayjs(rule.execution.startAt) : null
|
||||
@@ -218,7 +223,8 @@ function AutoScoreManager({ canEdit }: AutoScoreManagerProps): React.JSX.Element
|
||||
return t("autoScore.startAtHint")
|
||||
}
|
||||
|
||||
const intervalMinutes = intervalValue.days * 24 * 60 + intervalValue.hours * 60 + intervalValue.minutes
|
||||
const intervalMinutes =
|
||||
intervalValue.days * 24 * 60 + intervalValue.hours * 60 + intervalValue.minutes
|
||||
if (intervalMinutes <= 0) {
|
||||
return t("autoScore.startAtHint")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user