diff --git a/src/components/badrequest.html b/src/components/badrequest.html
deleted file mode 100644
index c202743..0000000
--- a/src/components/badrequest.html
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
- Bad Request!
-
-
-
-
-
-
-
-
-
-
-
-
Oops!
-
There was some problem with the authentication process...
-
{{ .message }}
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/components/infoblock.html b/src/components/infoblock.html
deleted file mode 100644
index e69de29..0000000
diff --git a/src/components/internalservererror.html b/src/components/internalservererror.html
deleted file mode 100644
index ca751cf..0000000
--- a/src/components/internalservererror.html
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
- Internal Server Error!
-
-
-
-
-
-
-
-
-
-
-
-
Oops!
-
We experienced some kind of server error...
-
{{ .message }}
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/router/index.ts b/src/router/index.ts
index 7dd9727..f57df19 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -11,13 +11,13 @@ const router = createRouter({
name: 'home',
component: HomeView,
beforeEnter: (to) => {
- isLoggedIn().then((response) => {
+ return isLoggedIn().then((response) => {
if (response) {
const redirect = to.query.redirect?.toString()
if (redirect != undefined) {
- router.replace(redirect)
+ return redirect
} else {
- router.replace('/dashboard')
+ return '/dashboard'
}
}
})
@@ -35,9 +35,9 @@ const router = createRouter({
router.beforeEach((to) => {
if (to.meta.requiresAuth) {
- isLoggedIn().then((response) => {
+ return isLoggedIn().then((response) => {
if (response == false) {
- router.replace('/?redirect=' + to.fullPath)
+ return '/?redirect=' + to.fullPath
}
})
}
diff --git a/src/ts/user_info.ts b/src/ts/user_info.ts
index be0be0b..bd95fca 100644
--- a/src/ts/user_info.ts
+++ b/src/ts/user_info.ts
@@ -11,18 +11,22 @@ export const user_store = reactive({
export function update_info() {
fetch('http://localhost:31337/dashboard', {
credentials: 'include',
- }).then((res) => {
- res.json().then((userjson) => {
- console.log(userjson)
- user_store.Avatar_Decoration =
- 'https://cdn.discordapp.com/avatar-decoration-presets/' +
- userjson.Avatar_Decoration_Data.Asset +
- '.png'
- user_store.Avatar =
- 'https://cdn.discordapp.com/avatars/' + userjson.Id + '/' + userjson.Avatar + '.png'
- user_store.Id = 'https://discord.com/users/' + userjson.Id
- user_store.Global_Name = userjson.Global_Name
- user_store.Username = userjson.Username
- })
})
+ .then((res) => {
+ res
+ .json()
+ .then((userjson) => {
+ user_store.Avatar_Decoration =
+ 'https://cdn.discordapp.com/avatar-decoration-presets/' +
+ userjson.Avatar_Decoration_Data.Asset +
+ '.png'
+ user_store.Avatar =
+ 'https://cdn.discordapp.com/avatars/' + userjson.Id + '/' + userjson.Avatar + '.png'
+ user_store.Id = 'https://discord.com/users/' + userjson.Id
+ user_store.Global_Name = userjson.Global_Name
+ user_store.Username = userjson.Username
+ })
+ .catch(() => {})
+ })
+ .catch(() => {})
}