Update to Kirby 5
This commit is contained in:
parent
5d9979fca8
commit
0fefc5e2e1
472 changed files with 30853 additions and 10301 deletions
|
@ -15,7 +15,9 @@ return [
|
|||
return $this->resolve($user)->view('auth');
|
||||
}
|
||||
|
||||
throw new NotFoundException('The user cannot be found');
|
||||
throw new NotFoundException(
|
||||
message: 'The user cannot be found'
|
||||
);
|
||||
}
|
||||
],
|
||||
[
|
||||
|
@ -27,7 +29,9 @@ return [
|
|||
|
||||
// csrf token check
|
||||
if ($auth->type() === 'session' && $auth->csrf() === false) {
|
||||
throw new InvalidArgumentException('Invalid CSRF token');
|
||||
throw new InvalidArgumentException(
|
||||
message: 'Invalid CSRF token'
|
||||
);
|
||||
}
|
||||
|
||||
$user = $auth->verifyChallenge($this->requestBody('code'));
|
||||
|
@ -49,7 +53,9 @@ return [
|
|||
|
||||
// csrf token check
|
||||
if ($auth->type() === 'session' && $auth->csrf() === false) {
|
||||
throw new InvalidArgumentException('Invalid CSRF token');
|
||||
throw new InvalidArgumentException(
|
||||
message: 'Invalid CSRF token'
|
||||
);
|
||||
}
|
||||
|
||||
$email = $this->requestBody('email');
|
||||
|
@ -58,7 +64,9 @@ return [
|
|||
|
||||
if ($password) {
|
||||
if (isset($methods['password']) !== true) {
|
||||
throw new InvalidArgumentException('Login with password is not enabled');
|
||||
throw new InvalidArgumentException(
|
||||
message: 'Login with password is not enabled'
|
||||
);
|
||||
}
|
||||
|
||||
if (
|
||||
|
@ -73,7 +81,9 @@ return [
|
|||
$mode = match (true) {
|
||||
isset($methods['code']) => 'login',
|
||||
isset($methods['password-reset']) => 'password-reset',
|
||||
default => throw new InvalidArgumentException('Login without password is not enabled')
|
||||
default => throw new InvalidArgumentException(
|
||||
message: 'Login without password is not enabled'
|
||||
)
|
||||
};
|
||||
|
||||
$status = $auth->createChallenge($email, $long, $mode);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue