gancio-upstream/middleware/isAdminOrEditor.js

5 lines
No EOL
151 B
JavaScript

export default async function ({ redirect, $auth }) {
if (!$auth?.user?.is_editor && !$auth?.user?.is_admin) {
return redirect('/')
}
}