mirror of
https://github.com/hanzoai/sign.git
synced 2026-11-02 23:26:15 +00:00
The resource API is /v1/rest and the operation API is /v1/rpc: named for what they are, so neither shadows the other, and the v2-beta alias is gone. Hanzo IAM returns to /auth/callback, the callback path IAM already derives for this host, so sign-in needs no IAM change. Claude-Session: https://claude.ai/code/session_01TUxvfuta1Z44KVNYuAz71F
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) },
|
|
});
|
|
};
|