# wpide/trunk/App/Controllers/AuthController.php

WPIDE – File Manager &amp; Code Editor, version trunk. 25 lines.

- Page: https://pluginprobe.com/plugins/wpide/trunk/code/App/Controllers/AuthController.php
- Raw: https://pluginprobe.com/plugins/wpide/trunk/raw/App/Controllers/AuthController.php
- Modified: 2022-07-30T20:33:10+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wpide/trunk/code/App/Controllers/AuthController.php#L10-L20`.

```php
<?php

namespace WPIDE\App\Controllers;

use WPIDE\App\Kernel\Response;
use WPIDE\App\Services\Auth\AuthInterface;
use WPIDE\App\Services\Logger\LoggerInterface;

class AuthController
{
    protected $logger;

    public function __construct(LoggerInterface $logger)
    {
        $this->logger = $logger;
    }

    public function getUser(Response $response, AuthInterface $auth)
    {
        $user = $auth->user() ?: $auth->getGuest();

        return $response->json($user);
    }
}

```
