Skip to content

Commit

Permalink
fix auth manager
Browse files Browse the repository at this point in the history
  • Loading branch information
kyoh86 committed Apr 1, 2024
1 parent 7ba7d08 commit 6903aea
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions token.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,13 @@ func (t TokenManager) Get(host, owner string) Token {
return t.Hosts.TryGet(host, &TokenHost{}).Owners.Get(owner)
}

func (t *TokenManager) Set(host, owner string, token Token) {
hosts := t.Hosts.TryGet(host, &TokenHost{})
t.Hosts.Set(host, hosts)
func (t *TokenManager) Set(hostName, ownerName string, token Token) {
host := t.Hosts.TryGet(hostName, &TokenHost{})
if host.DefaultOwner == "" {
host.DefaultOwner = ownerName
}
host.Owners.Set(ownerName, token)
t.Hosts.Set(hostName, host)
}

func (t TokenManager) Delete(host, owner string) {
Expand Down

0 comments on commit 6903aea

Please sign in to comment.