Skip to content

Commit 6a1d969

Browse files
fix(endpoint-auth): respect user configured endpoints
1 parent e499a4f commit 6a1d969

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

packages/endpoint-auth/index.js

+14-3
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,19 @@ export default class AuthorizationEndpoint {
6363
init(Indiekit) {
6464
Indiekit.addEndpoint(this);
6565

66-
Indiekit.config.application.authorizationEndpoint = this.mountPath;
67-
Indiekit.config.application.introspectionEndpoint = `${this.mountPath}/introspect`;
68-
Indiekit.config.application.tokenEndpoint = `${this.mountPath}/token`;
66+
// Only mount if authorization endpoint not already configured
67+
if (!Indiekit.config.application.authorizationEndpoint) {
68+
Indiekit.config.application.authorizationEndpoint = this.mountPath;
69+
}
70+
71+
// Only mount if introspection endpoint not already configured
72+
if (!Indiekit.config.application.introspectionEndpoint) {
73+
Indiekit.config.application.introspectionEndpoint = `${this.mountPath}/introspect`;
74+
}
75+
76+
// Only mount if token endpoint not already configured
77+
if (!Indiekit.config.application.tokenEndpoint) {
78+
Indiekit.config.application.tokenEndpoint = `${this.mountPath}/token`;
79+
}
6980
}
7081
}

0 commit comments

Comments
 (0)