Quellcode durchsuchen

Add some views and remove a useless bit

master
Jared vor 1 Jahr
Ursprung
Commit
5fdbf73391
9 geänderte Dateien mit 53 neuen und 41 gelöschten Zeilen
  1. +8
    -8
      package-lock.json
  2. +1
    -0
      package.json
  3. +7
    -2
      src/App.vue
  4. +1
    -1
      src/lib/auth.ts
  5. +6
    -6
      src/router/index.ts
  6. +13
    -0
      src/views/ForbiddenView.vue
  7. +0
    -20
      src/views/LogoutView.vue
  8. +13
    -0
      src/views/NotFoundView.vue
  9. +4
    -4
      yarn.lock

+ 8
- 8
package-lock.json Datei anzeigen

@@ -26,6 +26,7 @@
"@types/chai": "^4.2.15",
"@types/luxon": "^3.1.0",
"@types/mocha": "^8.2.1",
"@types/node": "^18.11.19",
"@typescript-eslint/eslint-plugin": "^5.4.0",
"@typescript-eslint/parser": "^5.4.0",
"@vue/cli-plugin-babel": "~5.0.0",
@@ -2485,11 +2486,10 @@
"license": "MIT"
},
"node_modules/@types/node": {
"version": "18.11.9",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.9.tgz",
"integrity": "sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==",
"dev": true,
"license": "MIT"
"version": "18.11.19",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.19.tgz",
"integrity": "sha512-YUgMWAQBWLObABqrvx8qKO1enAvBUdjZOAWQ5grBAkp5LQv45jBvYKZ3oFS9iKRCQyFjqw6iuEa1vmFqtxYLZw==",
"dev": true
},
"node_modules/@types/normalize-package-data": {
"version": "2.4.1",
@@ -16514,9 +16514,9 @@
"dev": true
},
"@types/node": {
"version": "18.11.9",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.9.tgz",
"integrity": "sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==",
"version": "18.11.19",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.19.tgz",
"integrity": "sha512-YUgMWAQBWLObABqrvx8qKO1enAvBUdjZOAWQ5grBAkp5LQv45jBvYKZ3oFS9iKRCQyFjqw6iuEa1vmFqtxYLZw==",
"dev": true
},
"@types/normalize-package-data": {


+ 1
- 0
package.json Datei anzeigen

@@ -27,6 +27,7 @@
"@types/chai": "^4.2.15",
"@types/luxon": "^3.1.0",
"@types/mocha": "^8.2.1",
"@types/node": "^18.11.19",
"@typescript-eslint/eslint-plugin": "^5.4.0",
"@typescript-eslint/parser": "^5.4.0",
"@vue/cli-plugin-babel": "~5.0.0",


+ 7
- 2
src/App.vue Datei anzeigen

@@ -22,9 +22,9 @@
<RouterLink to="/admin/dashboard" class="button is-primary">
Admin
</RouterLink>
<RouterLink to="/logout" class="button is-white">
<button class="button is-white" @click="logout">
Log out
</RouterLink>
</button>
</div>
</div>
</div>
@@ -63,6 +63,7 @@ import {
} from 'vue';
import jwtDecode from 'jwt-decode';
import { Claims } from '@/api/types';
import { removeToken } from '@/lib/auth';

const userData = ref({
username: '',
@@ -113,6 +114,10 @@ const logoElements: LogoElement[] = [
letter: 't',
},
];

const logout = () => {
removeToken();
};
</script>

<style lang="stylus">


+ 1
- 1
src/lib/auth.ts Datei anzeigen

@@ -3,7 +3,7 @@ import jwtDecode from 'jwt-decode';
import { Claims } from '@/api/types';
import * as luxon from 'luxon';

const removeToken = () => {
export const removeToken = () => {
sessionStorage.removeItem('jwt');
store.commit('clearToken');
};


+ 6
- 6
src/router/index.ts Datei anzeigen

@@ -13,9 +13,9 @@ import AdminView from '@/views/AdminView.vue';
import ModifyQueueView from '@/views/ModifyQueueView.vue';
import AdminDashboardView from '@/views/AdminDashboardView.vue';
import ModifyUserView from '@/views/ModifyUserView.vue';
import LogoutView from '@/views/LogoutView.vue';
import ChangePasswordView from '@/views/ChangePasswordView.vue';
import store from '@/store';
import ForbiddenView from '@/views/ForbiddenView.vue';

const routes: Array<RouteRecordRaw> = [
{
@@ -42,11 +42,6 @@ const routes: Array<RouteRecordRaw> = [
component: ChangePasswordView,
meta: { title: 'Change Password' },
},
{
path: '/logout',
name: 'logout',
component: LogoutView,
},
{
path: '/admin',
name: 'admin',
@@ -122,6 +117,11 @@ const routes: Array<RouteRecordRaw> = [
title: 'Administrator',
},
},
{
path: '/forbidden',
name: 'forbidden',
component: ForbiddenView,
},
{
path: '/:pathMatch(.*)*',
name: 'wildcard',


+ 13
- 0
src/views/ForbiddenView.vue Datei anzeigen

@@ -0,0 +1,13 @@
<template>
<section class="section is-medium">
<span class="is-size-3">403</span>
<p>Forbidden</p>
</section>
</template>

<script setup lang="ts">
</script>

<style scoped>

</style>

+ 0
- 20
src/views/LogoutView.vue Datei anzeigen

@@ -1,20 +0,0 @@
<template>
<div>
Logging out...
</div>
</template>

<script setup lang="ts">
import { useRouter } from 'vue-router';
import store from '@/store';

store.commit('clearToken');
window.sessionStorage.removeItem('jwt');

const router = useRouter();
router.push('/');
</script>

<style scoped lang="stylus">

</style>

+ 13
- 0
src/views/NotFoundView.vue Datei anzeigen

@@ -0,0 +1,13 @@
<template>

</template>

<script setup lang="ts">
export default {
name: "NotFoundView"
}
</script>

<style scoped>

</style>

+ 4
- 4
yarn.lock Datei anzeigen

@@ -1270,10 +1270,10 @@
"resolved" "https://registry.npmjs.org/@types/mocha/-/mocha-8.2.3.tgz"
"version" "8.2.3"

"@types/node@*":
"integrity" "sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg=="
"resolved" "https://registry.npmjs.org/@types/node/-/node-18.11.9.tgz"
"version" "18.11.9"
"@types/node@*", "@types/node@^18.11.19":
"integrity" "sha512-YUgMWAQBWLObABqrvx8qKO1enAvBUdjZOAWQ5grBAkp5LQv45jBvYKZ3oFS9iKRCQyFjqw6iuEa1vmFqtxYLZw=="
"resolved" "https://registry.npmjs.org/@types/node/-/node-18.11.19.tgz"
"version" "18.11.19"

"@types/normalize-package-data@^2.4.0":
"integrity" "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw=="


Laden…
Abbrechen
Speichern