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: {
|
methods: {
|
||||||
shouldAllowWriteToDisk() {
|
shouldAllowWriteToDisk() {
|
||||||
const { appConfig } = this.config;
|
const { appConfig } = this.config;
|
||||||
return appConfig.allowConfigEdit !== false && isUserAdmin(appConfig.auth);
|
return appConfig.allowConfigEdit !== false && isUserAdmin();
|
||||||
},
|
},
|
||||||
save() {
|
save() {
|
||||||
if (this.saveMode === 'local' || !this.allowWriteToDisk) {
|
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
|
* then they will never be able to view the homepage, so no button needed
|
||||||
*/
|
*/
|
||||||
userState() {
|
userState() {
|
||||||
return getUserState(this.appConfig || {});
|
return getUserState();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
|
|
@ -31,7 +31,7 @@ const isGuestEnabled = () => {
|
||||||
/* Returns true if user is already authenticated, or if auth is not enabled */
|
/* Returns true if user is already authenticated, or if auth is not enabled */
|
||||||
const isAuthenticated = () => {
|
const isAuthenticated = () => {
|
||||||
const users = config.appConfig.auth;
|
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 */
|
/* Get the users chosen starting view from app config, or return default */
|
||||||
|
|
|
@ -126,7 +126,7 @@ export default {
|
||||||
},
|
},
|
||||||
isUserAlreadyLoggedIn() {
|
isUserAlreadyLoggedIn() {
|
||||||
const users = this.appConfig.auth;
|
const users = this.appConfig.auth;
|
||||||
const loggedIn = (!users || users.length === 0 || isLoggedIn(users));
|
const loggedIn = (!users || users.length === 0 || isLoggedIn());
|
||||||
return (loggedIn && this.existingUsername);
|
return (loggedIn && this.existingUsername);
|
||||||
},
|
},
|
||||||
isGuestAccessEnabled() {
|
isGuestAccessEnabled() {
|
||||||
|
|
Loading…
Reference in New Issue