This section describes the authentication flow covering sign‑up, sign‑in, email verification, password reset, two‑factor authentication (2FA), and account deletion.
/auth/sign-up/auth/sign-in/auth/forgot-password/auth/reset-password/auth/verify-email/auth/2fa/auth/account-deleted/auth/accept-invite/:idForms employ Svelte’s two‑way binding and validation libraries; submission is handled client‑side with fetch calls.
The reusable ExampleToggle.svelte component can be used for UI tweaks like show/hide passwords.
Guard any direct window usage with if (!import.meta.env.SSR) for Cloudflare safety.
Sign‑Up – /auth/sign-up
Sign‑In – /auth/sign-in
Forgot Password – /auth/forgot-password
Reset Password – /auth/reset-password
Verify Email – /auth/verify-email
2FA Setup – /auth/2fa
Account Deleted – /auth/account-deleted
Accept Invite – /auth/accept-invite/:id
| Endpoint | Method | Purpose |
|---|---|---|
/api/auth/signup | POST | Create a new user and send verification email |
/api/auth/signin | POST | Authenticate a user and return a session token |
/api/auth/forgot | POST | Send a password‑reset email |
/api/auth/reset/:token | POST | Reset password using token |
/api/auth/verify/:token | GET | Verify email address |
/api/auth/2fa/setup | POST | Configure two‑factor authentication |
/api/auth/delete | DELETE | Delete user account |
SignUpForm.svelteSignInForm.svelteForgotPasswordForm.svelteResetPasswordForm.svelteTwoFactorSetup.svelteAccountDeleted.svelte