Skip to content

Commit

Permalink
Fix redirect on login and update version number
Browse files Browse the repository at this point in the history
  • Loading branch information
bastianallgeier committed Jan 15, 2019
1 parent e8b7336 commit 72f01ea
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
16 changes: 10 additions & 6 deletions config/api/routes/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 72f01ea

Please sign in to comment.