Add UserRole handling

This commit is contained in:
lumijiez
2025-06-10 22:10:16 +03:00
parent beaacffb9a
commit a25459d2cb
15 changed files with 92 additions and 143 deletions

View File

@@ -10,13 +10,13 @@ export default function Home() {
const fetchAccessToken = async () => {
if (user) {
try {
const v = await fetch('/token');
await fetch('/token');
} catch (error) {
console.error("Error fetching token");
}
} else {
try {
const resp = await fetch('/untoken');
await fetch('/untoken');
} catch (e) {
console.error('Error in /api/untoken:', e);
}