mirror of
https://github.com/hanzoai/sign.git
synced 2026-11-02 23:26:15 +00:00
The product is branded Hanzo eSign (esign.hanzo.ai, repo hanzoai/esign). Rename all workspace packages @hanzo/sign-* → @hanzo/esign-* (1052 files) and align docker/Dockerfile turbo --scope/--filter to the actual remix package name @hanzo/esign (was a pre-existing mismatch with -remix that broke the build). Protected deps (@hanzo/insights, @hanzo/logo) untouched.
20 lines
599 B
TypeScript
20 lines
599 B
TypeScript
import type { ActionFunctionArgs } from 'react-router';
|
|
|
|
import { APP_I18N_OPTIONS } from '@hanzo/esign-lib/constants/i18n';
|
|
|
|
import { langCookie } from '~/storage/lang-cookie.server';
|
|
|
|
export const action = async ({ request }: ActionFunctionArgs) => {
|
|
const formData = await request.formData();
|
|
const lang = formData.get('lang') || '';
|
|
|
|
if (!APP_I18N_OPTIONS.supportedLangs.find((l) => l === lang)) {
|
|
throw new Response('Unsupported language', { status: 400 });
|
|
}
|
|
|
|
return new Response('OK', {
|
|
status: 200,
|
|
headers: { 'Set-Cookie': await langCookie.serialize(lang) },
|
|
});
|
|
};
|