mirror of
https://github.com/netbirdio/netbird.git
synced 2025-06-19 17:31:39 +02:00
fallback to olde keys if failing to fetch refreshed keys
This commit is contained in:
parent
90c8cfd863
commit
45224e76d0
@ -101,11 +101,14 @@ func NewJWTValidator(issuer string, audienceList []string, keysLocation string,
|
||||
if !keys.stillValid() {
|
||||
lock.Lock()
|
||||
defer lock.Unlock()
|
||||
keys, err = getPemKeys(keysLocation)
|
||||
|
||||
refreshedKeys, err := getPemKeys(keysLocation)
|
||||
if err != nil {
|
||||
log.Debugf("cannot get JSONWebKey: %v", err)
|
||||
return nil, err
|
||||
log.Debugf("cannot get JSONWebKey: %v, falling back to old keys", err)
|
||||
refreshedKeys = keys
|
||||
}
|
||||
|
||||
keys = refreshedKeys
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user