🔒 Small update to router, empty array means no users

This commit is contained in:
Alicia Sykes 2021-08-01 15:25:24 +01:00
parent 690409d642
commit ba2ac7661d
1 changed files with 6 additions and 1 deletions

View File

@ -11,9 +11,14 @@ import { metaTagData } from '@/utils/defaults';
Vue.use(Router);
/**
* Checks if the current user is either authenticated,
* or if authentication is not enabled
* @returns true if user logged in, or user management not enabled
*/
const isAuthenticated = () => {
const users = config.appConfig.auth;
return (!users || isLoggedIn(users));
return (!users || users.length === 0 || isLoggedIn(users));
};
const router = new Router({