33 lines
559 B
PHP
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();
|
|
}
|
|
}
|
|
|