fix: standard object metadata override (#13215)
# Issue - fix #13156, related #13105 --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -519,7 +519,7 @@ export class AuthResolver {
|
||||
return await this.resetPasswordService.sendEmailPasswordResetLink(
|
||||
resetToken,
|
||||
emailPasswordResetInput.email,
|
||||
context.req.headers['x-locale'] || SOURCE_LOCALE,
|
||||
context.req.locale,
|
||||
);
|
||||
}
|
||||
|
||||
@ -535,11 +535,7 @@ export class AuthResolver {
|
||||
passwordResetToken,
|
||||
);
|
||||
|
||||
await this.authService.updatePassword(
|
||||
id,
|
||||
newPassword,
|
||||
context.req.headers['x-locale'] || SOURCE_LOCALE,
|
||||
);
|
||||
await this.authService.updatePassword(id, newPassword, context.req.locale);
|
||||
|
||||
return await this.resetPasswordService.invalidatePasswordResetToken(id);
|
||||
}
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
import { UseFilters, UseGuards, UsePipes } from '@nestjs/common';
|
||||
import { Args, Context, Mutation, Resolver } from '@nestjs/graphql';
|
||||
|
||||
import { SOURCE_LOCALE } from 'twenty-shared/translations';
|
||||
|
||||
import { DomainManagerService } from 'src/engine/core-modules/domain-manager/services/domain-manager.service';
|
||||
import { ResendEmailVerificationTokenInput } from 'src/engine/core-modules/email-verification/dtos/resend-email-verification-token.input';
|
||||
import { ResendEmailVerificationTokenOutput } from 'src/engine/core-modules/email-verification/dtos/resend-email-verification-token.output';
|
||||
@ -41,7 +39,7 @@ export class EmailVerificationResolver {
|
||||
return await this.emailVerificationService.resendEmailVerificationToken(
|
||||
resendEmailVerificationTokenInput.email,
|
||||
workspace,
|
||||
context.req.headers['x-locale'] ?? SOURCE_LOCALE,
|
||||
context.req.locale,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@ import { APP_LOCALES, SOURCE_LOCALE } from 'twenty-shared/translations';
|
||||
@Injectable()
|
||||
export class I18nMiddleware implements NestMiddleware {
|
||||
use(req: Request, res: Response, next: NextFunction) {
|
||||
const locale = req.headers['x-locale'] as keyof typeof APP_LOCALES;
|
||||
const locale = req.locale;
|
||||
|
||||
if (locale && Object.values(APP_LOCALES).includes(locale)) {
|
||||
i18n.activate(locale);
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
import { APP_LOCALES } from 'twenty-shared/translations';
|
||||
export type I18nContext = {
|
||||
req: {
|
||||
headers: {
|
||||
'x-locale': (typeof APP_LOCALES)[keyof typeof APP_LOCALES] | undefined;
|
||||
};
|
||||
locale: keyof typeof APP_LOCALES;
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user