瀏覽代碼

user role redirect

feature/ticket
Charly 3 年之前
父節點
當前提交
8dbe4d01d3
共有 1 個檔案被更改,包括 1 行新增2 行删除
  1. +1
    -2
      Authenticator/LoginFormAuthenticator.php

+ 1
- 2
Authenticator/LoginFormAuthenticator.php 查看文件

@@ -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'];
}
}

Loading…
取消
儲存