Magic Link Login
Klub integrates with Kirby’s magic-link auth challenge. Use this page if you want passwordless login for members. Enable it in Kirby’s auth config before using these endpoints.
Enable magic-link
Ensure auth.methods includes magic-link in your Kirby configuration.
Request a magic link
POST /klub/magic-link sends a login link to the email if the user exists.
POST /klub/signup sends a login link and allows account creation on confirmation.
Required fields:
emailtoken(CSRF)
Optional:
redirect(where to go after confirmation)success_url(alternate name used by the magic link generator)name(used when creating a new user via signup)
Verify magic link
GET /klub/magic-link is triggered by the email link. Klub validates the token, logs in the user, and redirects safely.
Example
<form method="post" action="<?= site()->url() ?>/klub/magic-link">
<input type="email" name="email" required>
<input type="hidden" name="token" value="<?= csrf() ?>">
<input type="hidden" name="redirect" value="<?= url('account') ?>">
<button type="submit">Send magic link</button>
</form>