Skip to content

Commit

Permalink
try to fix login prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
probablyjassin committed Nov 12, 2024
1 parent 14c5958 commit 8665524
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,13 @@ const username = useCookie("username")
const password = useCookie("password")
const isLoggedIn = useState("isLoggedIn", (() => false))
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)
isLoggedIn.value = !!(response == 0)
onMounted(async () => {
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)
isLoggedIn.value = !!(response == 0)
} catch (error) {
isLoggedIn.value = false
}
})
</script>

0 comments on commit 8665524

Please sign in to comment.