chore: getJWTToken -> getSessionToken (#12371)

* getJWTToken -> getSessionToken

Ensure expiry is included in payload

* Refactor test harness to avoid direct usage of getSessionToken
This commit is contained in:
Tom Moor authored and GitHub committed 2026-05-17 16:58:52 -04:00
1 parent 4774fa4fd0
commit 77cee2806c
51 files changed
+1164 -2224

No files matched your search

+3 -3
View File
@@ -14,7 +14,7 @@ describe("#github.callback", () => {
const res = await server.get(
`/api/github.callback?state=${encodeURIComponent(
state
)}&code=123&setup_action=${SetupAction.install}&installation_id=1&token=${user.getJwtToken()}`,
)}&code=123&setup_action=${SetupAction.install}&installation_id=1&token=${user.getSessionToken()}`,
{ redirect: "manual" }
);
const body = await res.json();
@@ -28,7 +28,7 @@ describe("#github.callback", () => {
const res = await server.get(
`/api/github.callback?state=${encodeURIComponent(
state
)}&code=123&setup_action=${SetupAction.install}&installation_id=1&token=${user.getJwtToken()}`,
)}&code=123&setup_action=${SetupAction.install}&installation_id=1&token=${user.getSessionToken()}`,
{ redirect: "manual" }
);
expect(res.status).toEqual(400);
@@ -37,7 +37,7 @@ describe("#github.callback", () => {
it("should fail when state is not valid JSON", async () => {
const user = await buildUser();
const res = await server.get(
`/api/github.callback?state=bad&code=123&setup_action=${SetupAction.install}&installation_id=1&token=${user.getJwtToken()}`,
`/api/github.callback?state=bad&code=123&setup_action=${SetupAction.install}&installation_id=1&token=${user.getSessionToken()}`,
{ redirect: "manual" }
);
expect(res.status).toEqual(400);