aboutsummaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorBobby <[email protected]>2026-03-07 14:25:54 +0530
committerBobby <[email protected]>2026-03-07 14:25:54 +0530
commit41926c10ea2e8496ce4b528262f5047ccbe6f155 (patch)
tree67ff5a27bb50faec368cf7ef38a1b1f2866459dd /config
parented2a033d7c08e448f5c6fd035e2de8f51431b597 (diff)
downloaddove-41926c10ea2e8496ce4b528262f5047ccbe6f155.tar.xz
dove-41926c10ea2e8496ce4b528262f5047ccbe6f155.zip
Implement authentication system with login/logout functionality and session management
Diffstat (limited to 'config')
-rw-r--r--config/config.go7
-rw-r--r--config/functions.go4
2 files changed, 9 insertions, 2 deletions
diff --git a/config/config.go b/config/config.go
index 78eb6a8..ed9dab3 100644
--- a/config/config.go
+++ b/config/config.go
@@ -14,8 +14,9 @@ var (
)
var (
- DataDir string
- DevMode bool
+ AuthEnabled bool
+ DataDir string
+ DevMode bool
)
func init() {
@@ -34,5 +35,7 @@ func init() {
}
}
+ AuthEnabled = isAuthEnabled()
+
logger.Successf(LOG_PREFIX, messages.ConfigLoaded)
}
diff --git a/config/functions.go b/config/functions.go
index 58ab717..1a49226 100644
--- a/config/functions.go
+++ b/config/functions.go
@@ -56,3 +56,7 @@ func loadConfigFile(configFilePath string) error {
func parseSection(target any) error {
return toml.Parse(target)
}
+
+func isAuthEnabled() bool {
+ return Server.Username != "" && Server.Password != ""
+}