Skip to content

Commit

Permalink
fix(oidc): change default OIDC path
Browse files Browse the repository at this point in the history
BREAKING CHANGE: default value for `oidc.path` is `/oidc`
  • Loading branch information
Romakita committed Apr 15, 2022
1 parent a7806ae commit 50e5588
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/security/oidc-provider/.nycrc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
],
"check-coverage": true,
"statements": 99.67,
"branches": 77.78,
"branches": 77.36,
"functions": 96.07,
"lines": 99.65
}
4 changes: 2 additions & 2 deletions packages/security/oidc-provider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"jose2": "npm:jose@^2.0.4",
"koa-mount": "^4.0.0",
"koa-rewrite": "^3.0.1",
"lowdb": "3.0.0",
"tslib": "2.3.1",
"uuid": "8.3.2"
},
Expand All @@ -47,6 +46,7 @@
"@types/lowdb": "1.0.11",
"@types/oidc-provider": "^7.1.1",
"@types/uuid": "8.3.4",
"lowdb": "3.0.0",
"oidc-provider": "7.10.6"
},
"peerDependencies": {
Expand All @@ -58,4 +58,4 @@
"optional": false
}
}
}
}
2 changes: 1 addition & 1 deletion packages/security/oidc-provider/src/OidcModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class OidcModule {
@Constant("PLATFORM_NAME")
platformName: string;

@Constant("oidc.path", "/")
@Constant("oidc.path", "/oidc")
basePath: string;

@Inject()
Expand Down
6 changes: 3 additions & 3 deletions packages/security/oidc-provider/test/oidc.integration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe("OIDC", () => {
it("should display the OIDC login page then login", async () => {
const authRes = await request
.get(
"/auth?client_id=client_id&response_type=id_token&scope=openid+email&nonce=foobar&prompt=login&redirect_uri=http://localhost:3000"
"/oidc/auth?client_id=client_id&response_type=id_token&scope=openid+email&nonce=foobar&prompt=login&redirect_uri=http://localhost:3000"
)
.set({
Origin: "http://0.0.0.0:8081",
Expand All @@ -74,7 +74,7 @@ describe("OIDC", () => {
})
.send("email=test%40test.com&password=admin");

expect(postResponse.headers.location).to.equal(`http://0.0.0.0:8081/auth/${id}`);
expect(postResponse.headers.location).to.equal(`http://0.0.0.0:8081/oidc/auth/${id}`);

const headers = {
Origin: "http://0.0.0.0:8081",
Expand Down Expand Up @@ -106,7 +106,7 @@ describe("OIDC", () => {
Origin: "http://0.0.0.0:8081",
Host: "0.0.0.0:8081"
});
expect(JSON.parse(res.text).authorization_endpoint).to.be.equal("http://0.0.0.0:8081/auth");
expect(JSON.parse(res.text).authorization_endpoint).to.be.equal("http://0.0.0.0:8081/oidc/auth");
});
});

Expand Down

0 comments on commit 50e5588

Please sign in to comment.