mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 00:03:33 +10:00
fix: set lang cookie expiry (#1365)
## Description Currently the language cookie is set to session, so restarting browser will reset it. This sets the expiry for two years. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced language preference functionality with extended cookie lifespan for improved user experience. - **Bug Fixes** - Resolved issues related to cookie expiration for language settings. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@ -4,5 +4,8 @@ import { cookies } from 'next/headers';
|
|||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/require-await
|
// eslint-disable-next-line @typescript-eslint/require-await
|
||||||
export const switchI18NLanguage = async (lang: string) => {
|
export const switchI18NLanguage = async (lang: string) => {
|
||||||
cookies().set('language', lang);
|
// Two year expiry.
|
||||||
|
const maxAge = 60 * 60 * 24 * 365 * 2;
|
||||||
|
|
||||||
|
cookies().set('language', lang, { maxAge });
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user