Pārlūkot izejas kodu

user role redirect

feature/ticket
Charly pirms 3 gadiem
vecāks
revīzija
8dbe4d01d3
1 mainītis faili ar 1 papildinājumiem un 2 dzēšanām
  1. +1
    -2
      Authenticator/LoginFormAuthenticator.php

+ 1
- 2
Authenticator/LoginFormAuthenticator.php Parādīt failu

@@ -111,7 +111,6 @@ class LoginFormAuthenticator extends AbstractFormLoginAuthenticator implements P

if (isset($useReferer) && $useReferer == true) {
$url = $request->request->get('_target_path');

} else {
$user = $this->entityManager->getRepository(UserInterface::class)->findOneBy(['email' => $email]);

@@ -119,7 +118,7 @@ class LoginFormAuthenticator extends AbstractFormLoginAuthenticator implements P
$roles = $user->getRoles();

foreach ($rolesRedirection as $roleRedirect) {
if (array_search($roleRedirect['role'], $roles)) {
if (in_array($roleRedirect['role'], $roles)) {
$routeName = $roleRedirect['redirect'];
}
}

Notiek ielāde…
Atcelt
Saglabāt