Permalink
Browse files

Fix redirect on login and update version number

  • Loading branch information...
bastianallgeier committed Jan 15, 2019
1 parent e8b7336 commit 72f01eac0a7db59360894e0cfb44680276260174
Showing with 11 additions and 7 deletions.
  1. +1 −1 composer.json
  2. +10 −6 config/api/routes/auth.php
@@ -1,7 +1,7 @@
{
"name": "getkirby/cms",
"description": "The Kirby 3 core",
"version": "3.0.0-RC-6.0",
"version": "3.0.0",
"license": "proprietary",
"keywords": ["kirby", "cms", "core"],
"homepage": "https://getkirby.com",
@@ -35,12 +35,16 @@
$long = $this->requestBody('long');
$password = $this->requestBody('password');
if ($user = $this->kirby()->auth()->login($email, $password, $long)) {
return [
'code' => 200,
'status' => 'ok',
'user' => $this->resolve($user)->view('auth')->toArray()
];
try {
if ($user = $this->kirby()->auth()->login($email, $password, $long)) {
return [
'code' => 200,
'status' => 'ok',
'user' => $this->resolve($user)->view('auth')->toArray()
];
}
} catch (Throwable $e) {
// catch any kind of login error
}
throw new InvalidArgumentException('Invalid email or password');

0 comments on commit 72f01ea

Please sign in to comment.