Files
Fitness/web/index.php
T

19 lines
701 B
PHP

<?php
session_start();
?>
<!DOCTYPE html>
<html>
<head><title>Fitness - OIDC Demo</title></head>
<body>
<?php if (!isset($_SESSION['user'])): ?>
<a href="/login.php"><button>Login with Authelia</button></a>
<?php else: ?>
<h2>Welcome, <?= htmlspecialchars($_SESSION['user']['userinfo']['name'] ?? '??') ?>!</h2>
<p>Email: <?= htmlspecialchars($_SESSION['user']['userinfo']['email'] ?? '') ?></p>
<p>Groups: <?= htmlspecialchars(implode(', ', $_SESSION['user']['userinfo']['groups'] ?? [])) ?></p>
<p>JWT claims: <pre><?= htmlspecialchars(print_r($_SESSION['user']['claims'], true)) ?></pre></p>
<a href="/logout.php"><button>Logout</button></a>
<?php endif; ?>
</body>
</html>