Merge pull request #385 from cloudflare/sven/fix-alias-connectedActor

fix connectedActor in alias
This commit is contained in:
Sven Sauleau 2023-03-08 13:07:44 +01:00 committed by GitHub
commit a9a2372368
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 4 deletions

View File

@ -8,10 +8,9 @@ const zodSchema = zod$({
alias: z.string().min(1),
})
export const action = action$(async (data, { env, platform, html }) => {
export const action = action$(async (data, { platform, html }) => {
const db = await getDatabase(platform)
// eslint-disable-next-line
const connectedActor = (env as any).data.connectedActor
const connectedActor = platform.data.connectedActor
if (connectedActor === null) {
throw html(500, getErrorHtml('user not present in context'))
}
@ -40,7 +39,7 @@ export default component$(() => {
const saveAction = action()
return (
<Form class="login-form" preventdefault:submit action={saveAction}>
<Form class="login-form" action={saveAction}>
<div class="max-w-4xl py-14 px-8">
<h2 class="text-2xl font-bold mb-6">Account Aliases</h2>