Skip to content

Commit

Permalink
SQNC-46: latest.
Browse files Browse the repository at this point in the history
  • Loading branch information
n3op2 committed Nov 22, 2024
1 parent a7f6a60 commit 49e2b65
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"main": "src/index.ts",
"scripts": {
"build": "npm run tsoa:build && swc ./src -d ./build --strip-leading-paths --copy-files",
"test": "NODE_ENV=test ./node_modules/.bin/mocha --config ./test/mocharc.json ./test/**/*.test.ts",
"test": "SWCRC=true NODE_ENV=test node --enable-source-maps ./node_modules/.bin/mocha --config ./test/mocharc.json ./test/**/*.test.ts",
"lint": "prettier -c ./src ./test ./migrations",
"lint:fix": "npm run lint -- -w",
"depcheck": "depcheck",
Expand Down
2 changes: 1 addition & 1 deletion src/authentication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const exampleOptions: AuthOptions = {
const scopes = ((decoded as jwt.JwtPayload).scopes as string) || ''
return scopes.split(' ')
},
tryRefreshTokens: (_req: express.Request) => Promise.resolve(false),
tryRefreshTokens: () => Promise.resolve(false),
}

export const expressAuthentication = mkExpressAuthentication(exampleOptions)
4 changes: 2 additions & 2 deletions src/swagger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ export default async function loadApiSpec(env: Env): Promise<unknown> {
const swaggerBuffer = await fs.readFile(path.join(__dirname, '..', 'build', 'swagger.json'))
const swaggerJson = JSON.parse(swaggerBuffer.toString('utf8'))
swaggerJson.info.title += `:${API_SWAGGER_HEADING}`
swaggerJson.components.securitySchemes.oauth2.flows.authorizationCode.tokenUrl = tokenUrl
swaggerJson.components.securitySchemes.oauth2.flows.authorizationCode.refreshUrl = tokenUrl
swaggerJson.components.securitySchemes.oauth2.flows.clientCredentials.tokenUrl = tokenUrl
swaggerJson.components.securitySchemes.oauth2.flows.clientCredentials.refreshUrl = tokenUrl

return swaggerJson
}
5 changes: 2 additions & 3 deletions tsoa.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"oauth2": {
"type": "oauth2",
"flows": {
"authorizationCode": {
"clientCredentials": {
"scopes": []
}
}
Expand All @@ -25,7 +25,6 @@
"esm": true,
"routesDir": "src",
"iocModule": "src/ioc",
"authenticationModule": "./src/authentication.ts",
"noWriteIfUnchanged": true
"authenticationModule": "./src/authentication.ts"
}
}

0 comments on commit 49e2b65

Please sign in to comment.