Dashboard Test 1

Lecturer Dashboard
This commit is contained in:
AliGitGut
2023-05-29 21:50:45 +02:00
parent d90303f5c5
commit dc708392c8
2 changed files with 82 additions and 2 deletions
+7 -2
View File
@@ -22,8 +22,13 @@ export default function Login() {
url = "http://localhost:8080/users/check?sessionid=" + value;
fetch(url).then(r => r.json()).then(u => localStorage.setItem("userid", u.id))
await router.push("/semesteroverview")
let admin = 0
await fetch(url).then(o => o.json()).then(user => {
admin = user.permissions})
localStorage.setItem("admin", admin)
if(admin === 1) {
await router.push("/semesteroverview")
}else await router.push("/semesteroverviewLecturer")
} else {
setInputPassword("");