Skip to content

Commit 40a6400

Browse files
committed
handling optional expires_at
1 parent 8e240ad commit 40a6400

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

packages/api/proxyHandler.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ export const proxyHandler = async (req: Request) => {
1414
const protectedContext = getProtectedContext(ctx)
1515
const remoteContext = await getRemoteContext(protectedContext)
1616

17-
const credentialsExpired = remoteContext.remote.settings.oauth?.credentials
18-
.expires_at
17+
const credentialsExpired = remoteContext.remote.settings.oauth?.credentials?.expires_at
1918
? new Date(remoteContext.remote.settings.oauth.credentials.expires_at) <
2019
new Date()
2120
: false

0 commit comments

Comments
 (0)