mirror of
https://github.com/outline/outline.git
synced 2026-11-22 22:02:35 +03:00
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:
1 parent
4774fa4fd0
commit
77cee2806c
51 files changed
+1164
-2224
No files matched your search
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user