mirror of https://github.com/Lissy93/dashy.git
⚡ Refactor, no longer need parameter passed to Auth functions
This commit is contained in:
parent
d54bb517db
commit
b71e1548ee
|
@ -102,7 +102,7 @@ export default {
|
|||
methods: {
|
||||
shouldAllowWriteToDisk() {
|
||||
const { appConfig } = this.config;
|
||||
return appConfig.allowConfigEdit !== false && isUserAdmin(appConfig.auth);
|
||||
return appConfig.allowConfigEdit !== false && isUserAdmin();
|
||||
},
|
||||
save() {
|
||||
if (this.saveMode === 'local' || !this.allowWriteToDisk) {
|
||||
|
|
|
@ -114,7 +114,7 @@ export default {
|
|||
* then they will never be able to view the homepage, so no button needed
|
||||
*/
|
||||
userState() {
|
||||
return getUserState(this.appConfig || {});
|
||||
return getUserState();
|
||||
},
|
||||
},
|
||||
data() {
|
||||
|
|
|
@ -31,7 +31,7 @@ const isGuestEnabled = () => {
|
|||
/* Returns true if user is already authenticated, or if auth is not enabled */
|
||||
const isAuthenticated = () => {
|
||||
const users = config.appConfig.auth;
|
||||
return (!users || users.length === 0 || isLoggedIn(users) || isGuestEnabled());
|
||||
return (!users || users.length === 0 || isLoggedIn() || isGuestEnabled());
|
||||
};
|
||||
|
||||
/* Get the users chosen starting view from app config, or return default */
|
||||
|
|
|
@ -126,7 +126,7 @@ export default {
|
|||
},
|
||||
isUserAlreadyLoggedIn() {
|
||||
const users = this.appConfig.auth;
|
||||
const loggedIn = (!users || users.length === 0 || isLoggedIn(users));
|
||||
const loggedIn = (!users || users.length === 0 || isLoggedIn());
|
||||
return (loggedIn && this.existingUsername);
|
||||
},
|
||||
isGuestAccessEnabled() {
|
||||
|
|
Loading…
Reference in New Issue