We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 285cb19 commit 4a61876Copy full SHA for 4a61876
app/middleware/requireAdmin.ts
@@ -1,7 +1,9 @@
1
export default defineNuxtRouteMiddleware((to, from) => {
2
if (import.meta.client) return;
3
const { currentUser } = useAuth();
4
- const { admins } = useRuntimeConfig();
+ // 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(',')
7
8
9
if (!admins.includes(currentUser.value?.shortcode || '')) {
nuxt.config.ts
@@ -21,8 +21,5 @@ export default defineNuxtConfig({
21
tailwindcss: {},
22
autoprefixer: {}
23
}
24
- },
25
- runtimeConfig: {
26
- admins: process.env.WEBMASTERS!.split(',')
27
28
});
0 commit comments