Merge pull request #736 from stevvooe/authorization-interface-cleanup
Authorization interface cleanup
This commit is contained in:
commit
a6ef6c0dc3
7 changed files with 36 additions and 38 deletions
|
@ -518,7 +518,7 @@ func (app *App) authorized(w http.ResponseWriter, r *http.Request, context *Cont
|
|||
switch err := err.(type) {
|
||||
case auth.Challenge:
|
||||
// Add the appropriate WWW-Auth header
|
||||
err.ServeHTTP(w, r)
|
||||
err.SetHeaders(w)
|
||||
|
||||
if err := errcode.ServeJSON(w, v2.ErrorCodeUnauthorized.WithDetail(accessRecords)); err != nil {
|
||||
ctxu.GetLogger(context).Errorf("error serving error json: %v (from %v)", err, context.Errors)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue