Skip to content

Commit

Permalink
oaky
Browse files Browse the repository at this point in the history
  • Loading branch information
probablyjassin committed Nov 12, 2024
1 parent 7729a35 commit 6757e9e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions middleware/isLoggedIn.global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ export default defineNuxtRouteMiddleware(async (to, from) => {
if (to.fullPath !== "/stundenplan") {
return true
}
console.log(from.fullPath == "/stundenplan")
const username = useCookie("username")
const password = useCookie("password")
const isLoggedIn = useState("isLoggedIn", (() => false) as () => boolean)

if (from.fullPath == "/stundenplan") {
if (!isLoggedIn.value) {
try {
const test_url = `https://corsproxy.io/?https%3A%2F%2Fselfservice.campus-dual.de%2Fdash%2Fgetcp%3Fuser%3D${username.value}%26hash%3D${password.value}`
const response = await $fetch(test_url)
Expand Down

0 comments on commit 6757e9e

Please sign in to comment.