mirror of
https://github.com/netbirdio/netbird.git
synced 2025-06-20 01:38:41 +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() {
|
if !keys.stillValid() {
|
||||||
lock.Lock()
|
lock.Lock()
|
||||||
defer lock.Unlock()
|
defer lock.Unlock()
|
||||||
keys, err = getPemKeys(keysLocation)
|
|
||||||
|
refreshedKeys, err := getPemKeys(keysLocation)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Debugf("cannot get JSONWebKey: %v", err)
|
log.Debugf("cannot get JSONWebKey: %v, falling back to old keys", err)
|
||||||
return nil, err
|
refreshedKeys = keys
|
||||||
}
|
}
|
||||||
|
|
||||||
|
keys = refreshedKeys
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user