Skip to content

Commit

Permalink
Add mock expiry
Browse files Browse the repository at this point in the history
  • Loading branch information
mjac0bs committed Dec 8, 2023
1 parent 29c27a6 commit 9e2ab75
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/manager/src/mocks/serverHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1178,7 +1178,12 @@ export const handlers = [
return res(ctx.json(childAccount));
}),
rest.post('*/account/child-accounts/:euuid/token', (req, res, ctx) => {
// Proxy tokens expire in 15 minutes.
const now = new Date();
const expiry = new Date(now.setMinutes(now.getMinutes() + 15));

const proxyToken = appTokenFactory.build({
expiry: expiry.toISOString(),
token: `Bearer ${import.meta.env.REACT_APP_PROXY_PAT}`,
});
return res(ctx.json(proxyToken));
Expand Down

0 comments on commit 9e2ab75

Please sign in to comment.