Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
"type": "git",
"url": "https://github.com/PropelAuth/express"
},
"version": "2.1.28",
"version": "2.1.31",
"license": "MIT",
"keywords": [
"auth",
"express",
"user"
],
"dependencies": {
"@propelauth/node": "^2.1.28"
"@propelauth/node": "^2.1.31"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^19.0.0",
Expand Down
10 changes: 7 additions & 3 deletions test/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import nock from "nock"
import { v4 as uuid } from "uuid"
import { initAuth } from "../src"

const AUTH_URL = "https://auth.example.com"
const BASE_API_URL = "https://propelauth-api.com"
const AUTH_HOSTNAME = "auth.example.com"
const AUTH_URL = "https://" + AUTH_HOSTNAME
const ALGO = "RS256"

afterEach(() => {
Expand Down Expand Up @@ -571,9 +573,10 @@ async function setupTokenVerificationMetadataEndpoint() {
const { publicKey, privateKey } = await generateRsaKeyPair()
const apiKey = randomString()

const scope = nock(AUTH_URL)
const scope = nock(BASE_API_URL)
.get("/api/v1/token_verification_metadata")
.matchHeader("authorization", `Bearer ${apiKey}`)
.matchHeader("X-Propelauth-url", AUTH_HOSTNAME)
.reply(
200,
JSON.stringify({
Expand All @@ -587,9 +590,10 @@ async function setupTokenVerificationMetadataEndpoint() {
async function setupErrorTokenVerificationMetadataEndpoint(statusCode: number) {
const apiKey = randomString()

const scope = nock(AUTH_URL)
const scope = nock(BASE_API_URL)
.get("/api/v1/token_verification_metadata")
.matchHeader("authorization", `Bearer ${apiKey}`)
.matchHeader("X-Propelauth-url", AUTH_HOSTNAME)
.reply(statusCode)

return { apiKey, scope }
Expand Down