mirror of
https://github.com/filegator/filegator.git
synced 2025-08-12 09:43:59 +02:00
refactoring
This commit is contained in:
@@ -67,10 +67,6 @@ 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);
|
||||
}
|
||||
|
@@ -40,25 +40,21 @@ class SessionStorage implements Service, SessionStorageInterface
|
||||
|
||||
public function save()
|
||||
{
|
||||
return $this->getSession() !== null ? $this->getSession()->save() : false;
|
||||
$this->getSession()->save();
|
||||
}
|
||||
|
||||
public function set(string $key, $data)
|
||||
{
|
||||
return $this->getSession() !== null ? $this->getSession()->set($key, $data) : false;
|
||||
return $this->getSession()->set($key, $data);
|
||||
}
|
||||
|
||||
public function get(string $key, $default = null)
|
||||
{
|
||||
return $this->getSession() !== null ? $this->getSession()->get($key, $default) : $default;
|
||||
return $this->getSession() ? $this->getSession()->get($key, $default) : $default;
|
||||
}
|
||||
|
||||
public function invalidate()
|
||||
{
|
||||
if ($this->getSession() === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (! $this->getSession()->isStarted()) {
|
||||
$this->getSession()->start();
|
||||
}
|
||||
|
Reference in New Issue
Block a user