always create a keystore
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-auth-node': patch
|
||||
---
|
||||
|
||||
Address corner cases where the key store was not being created at startup
|
||||
@@ -141,7 +141,7 @@ export class IdentityClient {
|
||||
// Add a small margin in case clocks are out of sync
|
||||
const issuedAfterLastRefresh =
|
||||
payload?.iat && payload.iat > this.keyStoreUpdated - CLOCK_MARGIN_S;
|
||||
if (!keyStoreHasKey && issuedAfterLastRefresh) {
|
||||
if (!this.keyStore || (!keyStoreHasKey && issuedAfterLastRefresh)) {
|
||||
const url = await this.discovery.getBaseUrl('auth');
|
||||
const endpoint = new URL(`${url}/.well-known/jwks.json`);
|
||||
this.keyStore = createRemoteJWKSet(endpoint);
|
||||
|
||||
Reference in New Issue
Block a user