Upgrade to 3.2.3

This commit is contained in:
Bastian Allgeier
2019-08-06 10:24:12 +02:00
parent 40f095f5de
commit 02be32bb75
48 changed files with 356 additions and 114 deletions

View File

@@ -35,25 +35,13 @@ return [
$long = $this->requestBody('long');
$password = $this->requestBody('password');
try {
if ($user = $this->kirby()->auth()->login($email, $password, $long)) {
return [
'code' => 200,
'status' => 'ok',
'user' => $this->resolve($user)->view('auth')->toArray()
];
}
$user = $this->kirby()->auth()->login($email, $password, $long);
throw new NotFoundException(['key' => 'user.undefined']);
} catch (Throwable $e) {
if ($this->kirby()->option('debug') === true) {
throw $e;
} else {
// catch any kind of login error
}
}
throw new InvalidArgumentException('Invalid email or password');
return [
'code' => 200,
'status' => 'ok',
'user' => $this->resolve($user)->view('auth')->toArray()
];
}
],
[