mirror of
https://github.com/outline/outline.git
synced 2026-11-28 16:19:46 +03:00
fix: Align credential transport handling in authentication middleware (#13416)
Session tokens were accepted from the request body and query string, unlike the other credential types parsed by the same middleware. They are now only read from the cookie or the Authorization header. Short-lived single-use transfer tokens are unaffected, so the subdomain and desktop sign-in hand-offs continue to work. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
bae9790355
commit
0e3631c2ed
12 files changed
+135
-96
No files matched your search
@@ -14,7 +14,8 @@ 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.getSessionToken()}`,
|
||||
)}&code=123&setup_action=${SetupAction.install}&installation_id=1`,
|
||||
user,
|
||||
{ redirect: "manual" }
|
||||
);
|
||||
const body = await res.json();
|
||||
@@ -28,7 +29,8 @@ 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.getSessionToken()}`,
|
||||
)}&code=123&setup_action=${SetupAction.install}&installation_id=1`,
|
||||
user,
|
||||
{ redirect: "manual" }
|
||||
);
|
||||
expect(res.status).toEqual(400);
|
||||
@@ -37,7 +39,8 @@ 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.getSessionToken()}`,
|
||||
`/api/github.callback?state=bad&code=123&setup_action=${SetupAction.install}&installation_id=1`,
|
||||
user,
|
||||
{ redirect: "manual" }
|
||||
);
|
||||
expect(res.status).toEqual(400);
|
||||
|
||||
Reference in new issue
Block a user