phpstan & refactoring

This commit is contained in:
Milos Stojanovic
2019-06-14 13:07:01 +02:00
parent f6185c92ab
commit fa319eda36
8 changed files with 20 additions and 7 deletions

View File

@@ -67,6 +67,10 @@ class AuthController
return $response->json($errors->firstOfAll(), 422);
}
if ($auth->user() === null) {
return $response->json(['oldpassword' => 'Wrong password'], 422);
}
if (! $auth->authenticate($auth->user()->getUsername(), $request->input('oldpassword'))) {
return $response->json(['oldpassword' => 'Wrong password'], 422);
}