permissions finito
This commit is contained in:
@@ -52,7 +52,7 @@ readonly class AuthService
|
||||
$user = $this->userRepo->findByEmail(new Email($email));
|
||||
|
||||
if ($user->isEmpty()) {
|
||||
throw new LucentException("You account was not found");
|
||||
throw new LucentException("Your account was not found");
|
||||
}
|
||||
|
||||
if ($user->get()->isRemoved()) {
|
||||
@@ -74,6 +74,21 @@ readonly class AuthService
|
||||
$this->session->put(["user" => $user->get()->safe()]);
|
||||
}
|
||||
|
||||
public function refreshSession(){
|
||||
$user = $this->userRepo->findById($this->currentUserId());
|
||||
|
||||
if ($user->isEmpty()) {
|
||||
throw new LucentException("Your account was not found");
|
||||
}
|
||||
|
||||
if ($user->get()->isRemoved()) {
|
||||
throw new LucentException("Your account is not active");
|
||||
}
|
||||
|
||||
$newUser = $user->get();
|
||||
$this->session->put(["user" => $user->get()->safe()]);
|
||||
}
|
||||
|
||||
|
||||
public function create(string $name, string $email, array $roles): User
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user