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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user