diff options
| author | Bobby <[email protected]> | 2026-03-08 03:06:23 +0530 |
|---|---|---|
| committer | Bobby <[email protected]> | 2026-03-08 03:06:23 +0530 |
| commit | caf265e7050edefa64ecf7e13828ec9636bce867 (patch) | |
| tree | 6bb8554dbb34695a74c2dca556bf512998cf62ab /utils/auth | |
| parent | cca905d35412f1549400fc3d1aca6dc704d8cae6 (diff) | |
| download | dove-caf265e7050edefa64ecf7e13828ec9636bce867.tar.xz dove-caf265e7050edefa64ecf7e13828ec9636bce867.zip | |
Refactor configuration handling and add mail management features
- Removed dependency on messages package in TOML loading and parsing.
- Introduced new config constants and messages for better clarity and maintainability.
- Implemented mail user and mailbox management with corresponding controllers and views.
- Added new templates for mailboxes, mailbox creation, and user management.
- Enhanced logging and error handling throughout the application.
- Established a structured approach for applying default values in TOML configuration.
- Created new utility functions for SMTP and email handling.
Diffstat (limited to 'utils/auth')
| -rw-r--r-- | utils/auth/auth.go | 4 | ||||
| -rw-r--r-- | utils/auth/constants.go | 5 | ||||
| -rw-r--r-- | utils/auth/defaults.go | 5 |
3 files changed, 7 insertions, 7 deletions
diff --git a/utils/auth/auth.go b/utils/auth/auth.go index b3d322c..976d903 100644 --- a/utils/auth/auth.go +++ b/utils/auth/auth.go @@ -13,7 +13,7 @@ func IsAuthenticated(context *fiber.Ctx) bool { return false } - return activeSession.Get(SESSION_AUTHENTICATED_KEY) != nil + return activeSession.Get(AuthenticatedKey) != nil } func RequireAuthentication(handler fiber.Handler) fiber.Handler { @@ -32,7 +32,7 @@ func Authenticate(context *fiber.Ctx) error { return sessionError } - activeSession.Set(SESSION_AUTHENTICATED_KEY, true) + activeSession.Set(AuthenticatedKey, true) return activeSession.Save() } diff --git a/utils/auth/constants.go b/utils/auth/constants.go deleted file mode 100644 index 99f5a85..0000000 --- a/utils/auth/constants.go +++ /dev/null @@ -1,5 +0,0 @@ -package auth - -const ( - SESSION_AUTHENTICATED_KEY = "authenticated" -) diff --git a/utils/auth/defaults.go b/utils/auth/defaults.go new file mode 100644 index 0000000..e15ea0b --- /dev/null +++ b/utils/auth/defaults.go @@ -0,0 +1,5 @@ +package auth + +const ( + AuthenticatedKey = "authenticated" +) |
