Skip to content
Merged
Show file tree
Hide file tree
Changes from 53 commits
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
5298630
refact: `Kirby\Auth\Limits`
distantnative Dec 30, 2025
f7ef867
docs: Add missing docblock
distantnative Dec 30, 2025
e4ebcca
refact: `Kirby\Auth\Csrf`
distantnative Dec 28, 2025
5c6bc72
refact: Remove internal deprec `:: checkRateLimit`
distantnative Dec 31, 2025
7ce5b4c
refact: `Kirby\Auth\Methods`
distantnative Dec 30, 2025
76bf8af
refact: `Method::isAvailable()`
distantnative Dec 31, 2025
0d0adbe
refact: `Method::isUsingChallenges()`
distantnative Dec 31, 2025
fbcd0e5
fix: Use `LoginNotPermittedException`
distantnative Jan 1, 2026
40b210d
test: Add more unit tests
distantnative Jan 2, 2026
72a8030
fix: `Method::get()` is config-agnostic
distantnative Jan 2, 2026
1bb7154
refact: `Kirby\Auth\Method\BasicAuthMethod`
distantnative Dec 30, 2025
0049d2c
refact: Keep using `:: currentUserFromBasicAuth()`
distantnative Dec 31, 2025
a13dc2c
refact: `Kirby\Auth\User`
distantnative Dec 31, 2025
e486e34
test: Use auth test case
distantnative Jan 2, 2026
645f921
style: Fix cs
distantnative Jan 2, 2026
717ab12
refact: `::isAvailable()` always throws
distantnative Jan 5, 2026
e48dfb8
refact: `Kirby\Auth\Method\BasicAuthMethod`
distantnative Dec 30, 2025
15d253d
refact: Keep using `:: currentUserFromBasicAuth()`
distantnative Dec 31, 2025
6798d3d
Merge pull request #7844 from getkirby/v6/refact/auth-methods
bastianallgeier Jan 7, 2026
6197c62
Merge pull request #7845 from getkirby/v6/refact/auth-basic-method
bastianallgeier Jan 7, 2026
f8eed04
Merge branch 'v6/refact/auth' into v6/refact/auth-user
bastianallgeier Jan 7, 2026
57cd515
Merge pull request #7847 from getkirby/v6/refact/auth-user
bastianallgeier Jan 7, 2026
5ad223a
refact: `Kirby\Auth\Challenges`
distantnative Jan 1, 2026
872dc49
refact: Move `UserNotFoundException`
distantnative Jan 1, 2026
17c20bb
test: Add more unit tests
distantnative Jan 1, 2026
177bfac
test: Use auth test case
distantnative Jan 2, 2026
e57728d
test: Sort tests alphabetically
distantnative Jan 2, 2026
3d344e5
test: Test if session keys are created
distantnative Jan 2, 2026
23a92b2
refct: Use `User::hashPassword()`
distantnative Jan 7, 2026
5fb63cc
refact: Move exception to `Challenges::create()`
distantnative Jan 7, 2026
5e31e78
fix: Set full session info in `Challenges::create`
distantnative Jan 7, 2026
2441772
refact: `Challenge::isEnabled()`
distantnative Jan 7, 2026
6385edf
refact: `Methods::isEnabled()`
distantnative Jan 7, 2026
ff326a5
test: Add missing unit tests
distantnative Jan 7, 2026
6e11cad
refact: `Kirby\Auth\State`
distantnative Dec 31, 2025
1004a7f
refact: `Kirby\Auth\Status`
distantnative Dec 31, 2025
0bec083
fix: Pass full status array to login view
distantnative Jan 1, 2026
bdd6cf7
test: Use auth test case
distantnative Jan 2, 2026
0686889
refact: Migrate `Auth` class to `Kirby\Auth\Auth`
distantnative Dec 31, 2025
d539bd4
test: Add missing previous tests
distantnative Jan 3, 2026
a6ed294
style: Fix cs
distantnative Jan 7, 2026
a7d7ab2
Merge pull request #7849 from getkirby/v6/refact/auth-challenges
bastianallgeier Jan 8, 2026
87fe520
Merge pull request #7850 from getkirby/v6/refact/auth-status-state
bastianallgeier Jan 8, 2026
69a2368
Merge pull request #7856 from getkirby/v6/refact/auth-class-migration
bastianallgeier Jan 8, 2026
9ac3995
refact: `$user->changeSecret()`
distantnative Jan 1, 2026
5390f9c
fix: User rule type
distantnative Jan 8, 2026
3cd9442
Merge pull request #7853 from getkirby/v6/refact/auth-change-secret
bastianallgeier Jan 9, 2026
4fe3a08
Merge branch 'v6/develop' into v6/refact/auth
distantnative Jan 13, 2026
1b2e86f
Merge branch 'v6/develop' into v6/refact/auth
distantnative Jan 19, 2026
eb34ffc
Merge branch 'v6/develop' into v6/refact/auth
distantnative Jan 22, 2026
f245033
Merge branch 'v6/develop' into v6/refact/auth
distantnative Jan 24, 2026
56eb75e
test: Fix unit test performance
distantnative Jan 24, 2026
b474399
fix: `$content` as sensitive in `UserActions::changeSecret()`
distantnative Jan 25, 2026
833ba1e
style: Fix CS
lukasbestle Feb 1, 2026
6414047
Merge branch 'v6/develop' into v6/refact/auth
distantnative Feb 2, 2026
4c748bd
Merge branch 'v6/develop' into v6/refact/auth
distantnative Feb 2, 2026
6d14889
fix: Apply suggestions from code review
distantnative Feb 2, 2026
944558c
fix: Overwriting error in `::validatePassword()`
distantnative Feb 2, 2026
f194766
test: Use `Kirby\TestCase` for auth exceptions
distantnative Feb 2, 2026
8efea80
feat: User security drawer
distantnative Feb 3, 2026
50bf04a
refact!: User security TOTP drawer
distantnative Feb 23, 2026
3675d38
Merge branch 'v6/develop' into v6/refact/auth
distantnative Feb 26, 2026
2986499
Merge branch 'v6/develop' into v6/refact/auth
distantnative Mar 10, 2026
44c6f11
Merge branch 'v6/develop' into v6/refact/auth
distantnative Mar 17, 2026
f11093b
Merge branch 'v6/develop' into v6/refact/auth
distantnative Mar 21, 2026
28bb4d4
test: Fix user totp drawer controller unit test
distantnative Mar 22, 2026
ae4b947
Merge branch 'v6/develop' into v6/refact/auth
distantnative Mar 22, 2026
ac522ac
fix: Solve Psalm reported inconsistencies
distantnative Mar 22, 2026
19d9901
fix: Some auth refactoring fixes after review
distantnative Mar 22, 2026
f1e92b5
Merge branch 'v6/develop' into v6/refact/auth
distantnative Mar 22, 2026
8d67949
Merge branch 'v6/develop' into v6/refact/auth
distantnative Apr 8, 2026
217452a
Merge branch 'v6/develop' into v6/refact/auth
distantnative Apr 14, 2026
9be6585
Merge branch 'v6/develop' into v6/refact/auth
distantnative Apr 14, 2026
5ed1a9e
Merge branch 'v6/develop' into v6/refact/auth
distantnative Apr 14, 2026
b0b3224
[Auth] refact!: Remove legacy auth challenges support (#8044)
distantnative Apr 15, 2026
e54b1f9
[Auth] feat: Switch between auth challenges (#8063)
distantnative Apr 15, 2026
76326b9
Merge branch 'v6/develop' into v6/refact/auth
distantnative Apr 29, 2026
178f532
[Auth] feat: New login Vue components (#8077)
distantnative May 6, 2026
26a8aeb
Merge branch 'v6/develop' into v6/refact/auth
distantnative May 10, 2026
589dcf0
Merge branch 'v6/develop' into v6/refact/auth
distantnative May 12, 2026
e326744
[Auth] refact: `::form()` methods for methods/challenges (#8122)
distantnative May 13, 2026
842c360
[Auth] refact: Allow auth methods without email (#8123)
distantnative May 13, 2026
bf45a7d
Merge branch 'v6/develop' into v6/refact/auth
distantnative May 13, 2026
2953116
Merge branch 'v6/develop' into v6/refact/auth
distantnative May 15, 2026
1da6bd9
Merge branch 'v6/develop' into v6/refact/auth
distantnative May 15, 2026
05fd75a
fix: Regression in `::authenticateApiRequest()`
distantnative May 14, 2026
7d9ece9
fix: Do not fire user login failed hook twice
distantnative May 14, 2026
3dd5433
fix: `BasicAuth::isAttempted()`
distantnative May 14, 2026
871900d
fix: Auth user password timestamp check
distantnative May 14, 2026
09becee
Merge branch 'v6/develop' into v6/refact/auth
distantnative May 19, 2026
ec32d01
Merge branch 'v6/develop' into v6/refact/auth
distantnative Jun 2, 2026
1141c9a
Merge branch 'v6/develop' into v6/refact/auth
distantnative Jun 6, 2026
7c349fb
Merge branch 'v6/develop' into v6/refact/auth
distantnative Jun 8, 2026
7edf1db
Merge branch 'v6/develop' into v6/refact/auth
distantnative Jun 18, 2026
cb95a2d
refact: Login view for new auth architecture
distantnative Mar 21, 2026
3bcbdf4
fix: Revert not using is_string() for $password
distantnative Jun 6, 2026
adfca44
test: Complete unit tests for login controllers
distantnative Jun 6, 2026
63ef0a5
refact: Guard `::methods()` when challenge pending
distantnative Jun 6, 2026
e2d868b
fix: Ensure challenges are pure array lists
distantnative Jun 6, 2026
e57f259
Merge pull request #8045 from getkirby/v6/refact/auth-login-view
bastianallgeier Jun 19, 2026
79031a9
Merge branch 'v6/develop' into v6/refact/auth
distantnative Jun 19, 2026
ffaaf1a
Merge branch 'v6/develop' into v6/refact/auth
distantnative Jun 19, 2026
d556502
test: Fix Psalm baseline
distantnative Jun 19, 2026
5918b68
Merge branch 'v6/develop' into v6/refact/auth
distantnative Jun 23, 2026
2bb0041
docs: Fix Auth docblock
distantnative Jun 23, 2026
875248a
fix: `Auth::status()` caching
distantnative Jun 23, 2026
8f7a08c
refact: Add `#[SensitiveParameter]` to more places
distantnative Jun 23, 2026
2f0c805
fix: Login view for challenge with missing user
distantnative Jun 23, 2026
7b26abd
refact: Use `F::update()` for Auth limits (#8210)
distantnative Jun 24, 2026
299fa8c
Merge branch 'v6/develop' into v6/refact/auth
distantnative Jun 29, 2026
921c3b3
Merge branch 'v6/develop' into v6/refact/auth
distantnative Jun 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/aliases.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
// Any of these might be removed at any point in the future
'kirby\cms\api' => 'Kirby\Api\Api',
'kirby\cms\asset' => 'Kirby\Filesystem\Asset',
'kirby\cms\auth' => 'Kirby\Auth\Auth',
'kirby\cms\blueprint' => 'Kirby\Blueprint\Blueprint',
'kirby\cms\content' => 'Kirby\Content\Content',
'kirby\cms\dir' => 'Kirby\Filesystem\Dir',
Expand Down
43 changes: 8 additions & 35 deletions config/api/routes/auth.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php

use Kirby\Cms\User;
use Kirby\Exception\InvalidArgumentException;
use Kirby\Exception\NotFoundException;

Expand Down Expand Up @@ -48,8 +49,8 @@
'method' => 'POST',
'auth' => false,
'action' => function () {
$auth = $this->kirby()->auth();
$methods = $this->kirby()->system()->loginMethods();
// @codeCoverageIgnoreStart
$auth = $this->kirby()->auth();

// csrf token check
if ($auth->type() === 'session' && $auth->csrf() === false) {
Expand All @@ -58,50 +59,22 @@
);
}

$email = $this->requestBody('email');
$long = $this->requestBody('long');
$password = $this->requestBody('password');

if ($password) {
if (isset($methods['password']) !== true) {
throw new InvalidArgumentException(
message: 'Login with password is not enabled'
);
}

if (
isset($methods['password']['2fa']) === true &&
$methods['password']['2fa'] === true
) {
$status = $auth->login2fa($email, $password, $long);
} else {
$user = $auth->login($email, $password, $long);
}
} else {
$mode = match (true) {
isset($methods['code']) => 'login',
isset($methods['password-reset']) => 'password-reset',
default => throw new InvalidArgumentException(
message: 'Login without password is not enabled'
)
};

$status = $auth->createChallenge($email, $long, $mode);
}
$result = $auth->methods()->authenticateApiRequest($this);

if (isset($user)) {
if ($result instanceof User) {
return [
'code' => 200,
'status' => 'ok',
'user' => $this->resolve($user)->view('auth')->toArray()
'user' => $this->resolve($result)->view('auth')->toArray()
];
}

return [
'code' => 200,
'status' => 'ok',
'challenge' => $status->challenge()
'challenge' => $result->challenge()
];
// @codeCoverageIgnoreEnd
}
],
[
Expand Down
Loading