Refactor, no longer need parameter passed to Auth functions

This commit is contained in:
Alicia Sykes 2021-08-20 21:51:43 +01:00
parent d54bb517db
commit b71e1548ee
4 changed files with 4 additions and 4 deletions

View File

@ -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) {

View File

@ -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() {

View File

@ -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 */

View File

@ -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() {