Skip to content

Commit

Permalink
revert(middleware): revert middleware to reenable navigation guards
Browse files Browse the repository at this point in the history
  • Loading branch information
brucetony committed Jul 4, 2024
1 parent f19987a commit f36f528
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 3 deletions.
7 changes: 7 additions & 0 deletions middleware/auth.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default defineNuxtRouteMiddleware(async () => {
const { loggedIn, login } = useOidcAuth();
if (!loggedIn.value) {
console.warn("Not logged in");
return login();
}
});
4 changes: 2 additions & 2 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ export default defineNuxtConfig({
},
},
session: {
expirationCheck: false,
expirationCheck: true,
automaticRefresh: true,
maxAge: 3600,
},
middleware: {
globalMiddlewareEnabled: true,
globalMiddlewareEnabled: false,
customLoginPage: false,
},
},
Expand Down
6 changes: 5 additions & 1 deletion pages/about.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<script setup lang="ts"></script>
<script setup lang="ts">
definePageMeta({
middleware: ["auth"],
});
</script>

<template>
<p>
Expand Down
4 changes: 4 additions & 0 deletions pages/analyses.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<script setup lang="ts">
import AnalysesTable from "~/components/analysis/AnalysesTable.vue";
definePageMeta({
middleware: ["auth"],
});
</script>

<template>
Expand Down
4 changes: 4 additions & 0 deletions pages/data-stores/create.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<script setup lang="ts">
import DataStoreCreator from "~/components/data-stores/DataStoreCreator.vue";
import ProjectBinder from "~/components/data-stores/ProjectBinder.vue";
definePageMeta({
middleware: ["auth"],
});
</script>

<template>
Expand Down
4 changes: 4 additions & 0 deletions pages/data-stores/index.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<script setup lang="ts">
import DataStoreTable from "~/components/data-stores/DataStoreTable.vue";
definePageMeta({
middleware: ["auth"],
});
</script>

<template>
Expand Down
4 changes: 4 additions & 0 deletions pages/projects.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<script setup>
import ProjectTable from "~/components/projects/ProjectTable.vue";
definePageMeta({
middleware: ["auth"],
});
</script>

<template>
Expand Down
4 changes: 4 additions & 0 deletions pages/proposals.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<script setup lang="ts">
import ProposalTable from "~/components/projects/ProposalTable.vue";
definePageMeta({
middleware: ["auth"],
});
</script>

<template>
Expand Down

0 comments on commit f36f528

Please sign in to comment.