mirror of https://github.com/Lissy93/dashy.git
🔒 Small update to router, empty array means no users
This commit is contained in:
parent
690409d642
commit
ba2ac7661d
|
@ -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({
|
||||
|
|
Loading…
Reference in New Issue