1
0
mirror of https://github.com/JustKato/FreePad.git synced 2026-02-23 15:50:46 +02:00

Working on the admin interface

+ Implemented login token
+ Routing
+ Admin controller
+ Login Page
* Updated `.env` example
This commit is contained in:
2022-06-02 23:53:32 +03:00
parent 662dad90b7
commit d949b3decb
6 changed files with 164 additions and 1 deletions

View File

@@ -72,3 +72,18 @@ func GetCacheMapLimit() int {
return rez
}
// Get the admin token used to authenticate as an admin
func GetAdminToken() string {
// Get the admin login from the environment
adminToken, exists := os.LookupEnv("ADMIN_TOKEN")
// Check if the admin token was defined
if !exists {
// The admin token was not defined, disable admin logins
return ""
}
// Return the admin token
return adminToken
}