core-app-api: remove fallback to provider expiration

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2024-05-09 09:50:12 +02:00
parent 7183fe7df9
commit 1bed9a35c0
2 changed files with 7 additions and 7 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/core-app-api': patch
---
The Backstage identity session expiration check will no longer fall back to using the provider expiration. This was introduced to smooth out the rollout of Backstage release 1.18, and is no longer needed.
@@ -116,16 +116,11 @@ export default class OAuth2
},
};
if (backstageIdentity) {
// TODO(Rugvip): This fallback can be removed a few releases after 1.18. It's there to avoid
// breaking deployments that update their frontend before updating their backend.
const expInSec =
backstageIdentity.expiresInSeconds ??
res.providerInfo.expiresInSeconds;
session.backstageIdentity = {
token: backstageIdentity.token,
identity: backstageIdentity.identity,
expiresAt: expInSec
? new Date(Date.now() + expInSec * 1000)
expiresAt: backstageIdentity.expiresInSeconds
? new Date(Date.now() + backstageIdentity.expiresInSeconds * 1000)
: undefined,
};
}