mirror of https://github.com/statping/statping
fix for Authorization header
parent
2638ad379d
commit
b4159359b2
|
@ -23,8 +23,7 @@ func findService(r *http.Request) (*services.Service, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
user := IsUser(r)
|
if !servicer.Public.Bool && !IsReadAuthenticated(r) {
|
||||||
if !servicer.Public.Bool && !user {
|
|
||||||
return nil, errors.NotAuthenticated
|
return nil, errors.NotAuthenticated
|
||||||
}
|
}
|
||||||
return servicer, nil
|
return servicer, nil
|
||||||
|
|
|
@ -53,6 +53,7 @@ func (c *Core) Create() error {
|
||||||
MigrationId: utils.Now().Unix(),
|
MigrationId: utils.Now().Unix(),
|
||||||
}
|
}
|
||||||
q := db.Create(&newCore)
|
q := db.Create(&newCore)
|
||||||
|
utils.Log.Infof("API Key created: %s", secret)
|
||||||
return q.Error()
|
return q.Error()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue