fix(go): prevent panic on manage/api-keys
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
5d494fca8d
commit
5527caa3a8
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user