my-32bit-cafe/src/Controller/AuthController.php
2025-08-01 14:45:16 +01:00

33 lines
559 B
PHP

<?php
namespace Cafe32\My32bc\Controller;
use Cafe32\My32bc\Service\AuthentikOIDC;
class AuthController
{
private AuthentikOIDC $auth;
public function __construct()
{
$cfg = require r('/config/oidc.php');
$this->auth = new AuthentikOIDC($cfg);
}
public function login(): void
{
$this->auth->authenticate();
}
public function callback(): void
{
$this->auth->authenticate();
redirect('/dashboard');
}
public function logout(): void
{
$this->auth->logout();
}
}