mirror of
https://github.com/Quiq/docker-registry-ui.git
synced 2025-07-17 15:51:27 +00:00
Compatibility fix with docker_auth v1.5.0
This commit is contained in:
parent
b6398fa33c
commit
65c9978bd1
@ -13,6 +13,7 @@
|
||||
(thanks to @gminog).
|
||||
* Fix initial ownership of /opt/data dir in Dockerfile.
|
||||
* Hide repositories with 0 tags count.
|
||||
* Compatibility fix with docker_auth v1.5.0.
|
||||
|
||||
### 0.8.2 (2019-07-30)
|
||||
|
||||
|
@ -106,8 +106,14 @@ func (c *Client) getToken(scope string) string {
|
||||
return ""
|
||||
}
|
||||
|
||||
c.tokens[scope] = gjson.Get(data, "token").String()
|
||||
c.logger.Info("Received new token for scope ", scope)
|
||||
token := gjson.Get(data, "token").String()
|
||||
// Fix for docker_auth v1.5.0 only
|
||||
if token == "" {
|
||||
token = gjson.Get(data, "access_token").String()
|
||||
}
|
||||
|
||||
c.tokens[scope] = token
|
||||
c.logger.Debugf("Received new token for scope %s", scope)
|
||||
|
||||
return c.tokens[scope]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user