add direct invitation link
All checks were successful
deploy / build-and-deploy (push) Successful in 21s
All checks were successful
deploy / build-and-deploy (push) Successful in 21s
This commit is contained in:
18
src/pages/signup/[...hash].astro
Normal file
18
src/pages/signup/[...hash].astro
Normal file
@@ -0,0 +1,18 @@
|
||||
---
|
||||
import { db } from '@db/database.ts';
|
||||
import Signup from '@app/website/signup/Signup.astro';
|
||||
|
||||
const { hash } = Astro.params;
|
||||
|
||||
const directSignup = await db.getDirectSignupByHash({ hash: hash! });
|
||||
if (!directSignup) return new Response(null, { status: 404 });
|
||||
---
|
||||
|
||||
<Signup
|
||||
signupHash={hash}
|
||||
signupDisabled={directSignup.user
|
||||
? {
|
||||
message: 'Es hat sich bereits jemand mit diesem Einladungslink registriert'
|
||||
}
|
||||
: undefined}
|
||||
/>
|
||||
24
src/pages/signup/index.astro
Normal file
24
src/pages/signup/index.astro
Normal file
@@ -0,0 +1,24 @@
|
||||
---
|
||||
import { getSettings, SettingKey } from '@util/settings.ts';
|
||||
import { db } from '@db/database.ts';
|
||||
import Signup from '@app/website/signup/Signup.astro';
|
||||
|
||||
const signupSetting = await getSettings(db, [
|
||||
SettingKey.SignupEnabled,
|
||||
SettingKey.SignupDisabledMessage,
|
||||
SettingKey.SignupDisabledSubMessage
|
||||
]);
|
||||
const signupEnabled = signupSetting[SettingKey.SignupEnabled] ?? false;
|
||||
const signupDisabledMessage = signupSetting[SettingKey.SignupDisabledMessage] ?? 'Anmeldung deaktiviert';
|
||||
const signupDisabledSubMessage = signupSetting[SettingKey.SignupDisabledSubMessage] ?? '';
|
||||
---
|
||||
|
||||
<Signup
|
||||
signupDisabled={signupEnabled
|
||||
? undefined
|
||||
: {
|
||||
message: signupDisabledMessage,
|
||||
subMessage: signupDisabledSubMessage
|
||||
}}
|
||||
}
|
||||
/>
|
||||
Reference in New Issue
Block a user