Skip to content

Commit 4a61876

Browse files
committed
moved admins out of runtime config
1 parent 285cb19 commit 4a61876

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

app/middleware/requireAdmin.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
export default defineNuxtRouteMiddleware((to, from) => {
22
if (import.meta.client) return;
33
const { currentUser } = useAuth();
4-
const { admins } = useRuntimeConfig();
4+
// I am aware that the client might be able to Do Things, but that's okay
5+
// as if they have access to the admin page, everything is closed server-side anyways.
6+
const admins = process.env.WEBMASTERS!.split(',')
57

68

79
if (!admins.includes(currentUser.value?.shortcode || '')) {

nuxt.config.ts

-3
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,5 @@ export default defineNuxtConfig({
2121
tailwindcss: {},
2222
autoprefixer: {}
2323
}
24-
},
25-
runtimeConfig: {
26-
admins: process.env.WEBMASTERS!.split(',')
2724
}
2825
});

0 commit comments

Comments
 (0)