mirror of
https://github.com/Lissy93/dashy.git
synced 2025-07-03 20:04:48 +02:00
💥 (#177) Depricates old auth struct
This commit is contained in:
parent
2f3b89bbb0
commit
cff537b9ea
@ -46,7 +46,7 @@ const getUsers = () => {
|
|||||||
// Check if the user is still using previous schema type
|
// Check if the user is still using previous schema type
|
||||||
if (Array.isArray(auth)) {
|
if (Array.isArray(auth)) {
|
||||||
printWarning(); // Print warning message
|
printWarning(); // Print warning message
|
||||||
return auth; // Let the user proceed anyway, will remove in V 1.7.0
|
return []; // Support for old data structure now removed
|
||||||
}
|
}
|
||||||
// Otherwise, return the users array, if available
|
// Otherwise, return the users array, if available
|
||||||
return auth.users || [];
|
return auth.users || [];
|
||||||
@ -95,12 +95,7 @@ export const isAuthEnabled = () => {
|
|||||||
/* Returns true if guest access is enabled */
|
/* Returns true if guest access is enabled */
|
||||||
export const isGuestAccessEnabled = () => {
|
export const isGuestAccessEnabled = () => {
|
||||||
const appConfig = getAppConfig();
|
const appConfig = getAppConfig();
|
||||||
if (appConfig.enableGuestAccess) {
|
if (appConfig.auth && typeof appConfig.auth === 'object') {
|
||||||
// User is still using the old auth method
|
|
||||||
printWarning();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (appConfig.auth && !Array.isArray(appConfig.auth)) {
|
|
||||||
return appConfig.auth.enableGuestAccess || false;
|
return appConfig.auth.enableGuestAccess || false;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user