@@ -15,7 +15,9 @@ import { v4 as uuid } from "uuid"
1515import { initBaseAuth } from "../src"
1616import { RequiredOrgInfo } from "../src/auth"
1717
18- const AUTH_URL = "https://auth.example.com"
18+ const BASE_API_URL = "https://propelauth-api.com"
19+ const AUTH_HOSTNAME = "auth.example.com"
20+ const AUTH_URL = "https://" + AUTH_HOSTNAME
1921const ALGO = "RS256"
2022
2123afterEach ( ( ) => {
@@ -372,9 +374,10 @@ async function setupTokenVerificationMetadataEndpoint() {
372374 const { publicKey, privateKey } = await generateRsaKeyPair ( )
373375 const apiKey = randomString ( )
374376
375- const scope = nock ( AUTH_URL )
377+ const scope = nock ( BASE_API_URL )
376378 . get ( "/api/v1/token_verification_metadata" )
377379 . matchHeader ( "authorization" , `Bearer ${ apiKey } ` )
380+ . matchHeader ( "X-Propelauth-url" , AUTH_HOSTNAME )
378381 . reply (
379382 200 ,
380383 JSON . stringify ( {
@@ -388,8 +391,9 @@ async function setupTokenVerificationMetadataEndpoint() {
388391async function setupErrorTokenVerificationMetadataEndpoint ( statusCode : number ) {
389392 const apiKey = randomString ( )
390393
391- const scope = nock ( AUTH_URL )
394+ const scope = nock ( BASE_API_URL )
392395 . get ( "/api/v1/token_verification_metadata" )
396+ . matchHeader ( "X-Propelauth-url" , AUTH_HOSTNAME )
393397 . matchHeader ( "authorization" , `Bearer ${ apiKey } ` )
394398 . reply ( statusCode )
395399
0 commit comments