Skip to content

Commit d6ba1f4

Browse files
committed
chore: cleanup
1 parent 7af1d01 commit d6ba1f4

2 files changed

Lines changed: 5 additions & 8 deletions

File tree

packages/issuer-rest/lib/OID4VCIServer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ export class OID4VCIServer {
184184
this._app.use('/', rootRouter)
185185
}
186186

187-
getMetadataEndpoints(this.router, this.issuer, rootRouter, this.baseUrl)
187+
getMetadataEndpoints(this.router, this.issuer, rootRouter, basePath)
188188

189189
let issuerPayloadPath: string | undefined
190190
if (this.isGetIssuePayloadEndpointEnabled(opts?.endpointOpts?.getIssuePayloadOpts)) {

packages/issuer-rest/lib/oid4vci-api-functions.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ export function pushedAuthorizationEndpoint(
716716
})
717717
}
718718

719-
export function getMetadataEndpoints(router: Router, issuer: VcIssuer, rootRouter?: Router, baseUrl?: URL | string) {
719+
export function getMetadataEndpoints(router: Router, issuer: VcIssuer, rootRouter?: Router, basePath?: string) {
720720
const credentialIssuerHandler = (request: Request, response: Response) => {
721721
return response.json(issuer.issuerMetadata)
722722
}
@@ -730,12 +730,9 @@ export function getMetadataEndpoints(router: Router, issuer: VcIssuer, rootRoute
730730
router.get(WellKnownEndpoints.OAUTH_AS, authorizationServerHandler)
731731

732732
// Alternative root-level endpoints if rootRouter provided
733-
if (rootRouter && baseUrl) {
734-
const basePath = getBasePath(baseUrl)
735-
if (basePath && basePath !== '/') {
736-
rootRouter.get(`/.well-known/openid-credential-issuer${basePath}`, credentialIssuerHandler)
737-
rootRouter.get(`/.well-known/oauth-authorization-server${basePath}`, authorizationServerHandler)
738-
}
733+
if (rootRouter && basePath && basePath !== '/') {
734+
rootRouter.get(`/.well-known/openid-credential-issuer${basePath}`, credentialIssuerHandler)
735+
rootRouter.get(`/.well-known/oauth-authorization-server${basePath}`, authorizationServerHandler)
739736
}
740737
}
741738

0 commit comments

Comments
 (0)