add autoredirect auth config
It redirects the user to to the Host header's domain whenever they try to use token auth. Signed-off-by: David Wu <david.wu@docker.com>
This commit is contained in:
committed by
David Wu
parent
16128bbac4
commit
f730f3ab77
@@ -847,7 +847,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.SetHeaders(w)
|
||||
err.SetHeaders(r, w)
|
||||
|
||||
if err := errcode.ServeJSON(w, errcode.ErrorCodeUnauthorized.WithDetail(accessRecords)); err != nil {
|
||||
dcontext.GetLogger(context).Errorf("error serving error json: %v (from %v)", err, context.Errors)
|
||||
|
Reference in New Issue
Block a user