diff --git a/src/Controllers/AuthController.php b/src/Controllers/AuthController.php index ec76f6b8..21b01146 100644 --- a/src/Controllers/AuthController.php +++ b/src/Controllers/AuthController.php @@ -28,8 +28,8 @@ final class AuthController extends AbstractController throw new \Szurubooru\MissingArgumentException(); return [ - 'token' => $this->authService->getLoginToken(), - 'user' => $this->authService->getLoggedInUser() + 'token' => new \Szurubooru\ViewProxies\Token($this->authService->getLoginToken()), + 'user' => new \Szurubooru\ViewProxies\User($this->authService->getLoggedInUser()), ]; } } diff --git a/src/ViewProxies/Token.php b/src/ViewProxies/Token.php new file mode 100644 index 00000000..b31218ad --- /dev/null +++ b/src/ViewProxies/Token.php @@ -0,0 +1,17 @@ +name = $token->name; + $this->purpose = $token->purpose; + } +} diff --git a/src/ViewProxies/User.php b/src/ViewProxies/User.php new file mode 100644 index 00000000..6a27b21f --- /dev/null +++ b/src/ViewProxies/User.php @@ -0,0 +1,15 @@ +name = $user->name; + } +}