Commit 2eddb0e7 authored by Open Source Developer's avatar Open Source Developer
Browse files

trans

parent af1f9efc
...@@ -34,7 +34,7 @@ class CurrentUser extends ControllerBase ...@@ -34,7 +34,7 @@ class CurrentUser extends ControllerBase
$container->get('entity_type.manager'), $container->get('entity_type.manager'),
$container->get('database'), $container->get('database'),
$container->get('logger.factory') $container->get('logger.factory')
); );
} }
public function getLoginInfo(Request $request) public function getLoginInfo(Request $request)
...@@ -51,14 +51,14 @@ class CurrentUser extends ControllerBase ...@@ -51,14 +51,14 @@ class CurrentUser extends ControllerBase
$userRoles = $user->getRoles(); $userRoles = $user->getRoles();
foreach ($userRoles as $userRole) { foreach ($userRoles as $userRole) {
if ($userRole === 'epal') { if (($userRole === 'epal') || ($userRole === 'regioneduadmin') || ($userRole === 'eduadmin')) {
return $this->respondWithStatus([ return $this->respondWithStatus([
'name' => $user->mail->value, 'name' => $user->mail->value,
'title' => $user->init->value, 'title' => $user->init->value,
], Response::HTTP_OK); ], Response::HTTP_OK);
} else if ($userRole === 'applicant') { } else if ($userRole === 'applicant') {
break; break;
} }
} }
......
...@@ -22,6 +22,7 @@ export class AuthService { ...@@ -22,6 +22,7 @@ export class AuthService {
}).subscribe(loginInfo => { }).subscribe(loginInfo => {
if (loginInfo.size > 0) { if (loginInfo.size > 0) {
loginInfo.reduce(({}, loginInfoToken) => { loginInfo.reduce(({}, loginInfoToken) => {
console.log(loginInfoToken.auth_role,"aaaaaaa");
if (loginInfoToken.auth_token && loginInfoToken.auth_token.length > 0 && loginInfoToken.auth_role === role) { if (loginInfoToken.auth_token && loginInfoToken.auth_token.length > 0 && loginInfoToken.auth_role === role) {
resolve(true); resolve(true);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment