fix: remove unused date variable from email parsing in BasicAuth

This commit is contained in:
Zeke Zhang 2025-04-25 16:25:45 +08:00
parent ca1ed6c90e
commit c999ae4040
2 changed files with 2 additions and 5 deletions

View File

@ -152,9 +152,8 @@ const useVariableOptionsOfForgetPassword = () => {
const environmentVariables = useGlobalVariable('$env'); const environmentVariables = useGlobalVariable('$env');
const { currentUserSettings } = useCurrentUserVariable({ maxDepth: 1 }); const { currentUserSettings } = useCurrentUserVariable({ maxDepth: 1 });
const { systemSettings } = useSystemSettingsVariable(); const { systemSettings } = useSystemSettingsVariable();
const { datetimeSettings } = useDatetimeVariable({ noDisabled: true });
return [environmentVariables, currentUserSettings, datetimeSettings, systemSettings, { return [environmentVariables, currentUserSettings, systemSettings, {
value: '$resetLink', value: '$resetLink',
label: t('Reset password link'), label: t('Reset password link'),
}, { }, {

View File

@ -11,7 +11,7 @@ import { AuthConfig, BaseAuth } from '@nocobase/auth';
import { PasswordField } from '@nocobase/database'; import { PasswordField } from '@nocobase/database';
import _ from 'lodash'; import _ from 'lodash';
import { namespace } from '../preset'; import { namespace } from '../preset';
import { getDateVars, parsedValue } from '@nocobase/utils'; import { parsedValue } from '@nocobase/utils';
export class BasicAuth extends BaseAuth { export class BasicAuth extends BaseAuth {
static readonly optionsKeysNotAllowedInEnv = ['emailContentText', 'emailContentHTML', 'emailSubject']; static readonly optionsKeysNotAllowedInEnv = ['emailContentText', 'emailContentHTML', 'emailSubject'];
@ -209,7 +209,6 @@ export class BasicAuth extends BaseAuth {
const parsedSubject = parsedValue(emailSubject, { const parsedSubject = parsedValue(emailSubject, {
$user: user, $user: user,
$resetLink: resetLink, $resetLink: resetLink,
$nDate: getDateVars(),
$env: ctx.app.environment.getVariables(), $env: ctx.app.environment.getVariables(),
$resetLinkExpiration: resetTokenExpiresIn, $resetLinkExpiration: resetTokenExpiresIn,
$systemSettings: systemSettings, $systemSettings: systemSettings,
@ -218,7 +217,6 @@ export class BasicAuth extends BaseAuth {
const parsedContent = parsedValue(emailContentType === 'html' ? emailContentHTML : emailContentText, { const parsedContent = parsedValue(emailContentType === 'html' ? emailContentHTML : emailContentText, {
$user: user, $user: user,
$resetLink: resetLink, $resetLink: resetLink,
$nDate: getDateVars(),
$env: ctx.app.environment.getVariables(), $env: ctx.app.environment.getVariables(),
$resetLinkExpiration: resetTokenExpiresIn, $resetLinkExpiration: resetTokenExpiresIn,
$systemSettings: systemSettings, $systemSettings: systemSettings,