fix(go): prevent panic on manage/api-keys
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2023-09-04 15:12:58 +02:00
parent 5d494fca8d
commit 5527caa3a8
Signed by: wanderer
SSH Key Fingerprint: SHA256:MdCZyJ2sHLltrLBp0xQO0O1qTW9BT/xl5nXkDvhlMCI

View File

@ -12,12 +12,16 @@ import (
func ManageAPIKeys() echo.HandlerFunc {
return func(c echo.Context) error {
addHeaders(c)
u := c.Get("sessUsr").(moduser.User)
u := c.Get("sessUsr")
p := newPage()
p.Title = "Manage API Keys"
p.Current = "api-keys"
p.User = u
if _, ok := u.(moduser.User); ok {
p.User = u.(moduser.User)
}
if setting.APIKeyHIBP() != "" {
p.Data["hibpApiKey"] = setting.APIKeyHIBP()