Skip to content

Commit 427e28f

Browse files
authored
Merge pull request #19 from topcoder-platform/develop
Sync with develop
2 parents e9043c4 + b876f56 commit 427e28f

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
/node_modules
44
/build
55

6+
# migration files
7+
/prisma/Scorecards
8+
69
# Logs
710
logs
811
*.log

src/main.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,14 @@ async function bootstrap() {
3838
credentials: true,
3939
origin: process.env.CORS_ALLOWED_ORIGIN
4040
? new RegExp(process.env.CORS_ALLOWED_ORIGIN)
41-
: ['http://localhost:3000', /\.localhost:3000$/],
41+
: [
42+
'http://localhost:3000',
43+
/\.localhost:3000$/,
44+
'https://topcoder.com',
45+
'https://topcoder-dev.com',
46+
/\.topcoder-dev\.com$/,
47+
/\.topcoder\.com$/,
48+
],
4249
methods: 'GET, POST, OPTIONS, PUT, DELETE, PATCH',
4350
};
4451
app.use(cors(corsConfig));

src/shared/modules/global/jwt.service.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,12 @@ export class JwtService implements OnModuleInit {
9494
// Get the signing key from Auth0
9595
const signingKey = await this.getSigningKey(tokenHeader.kid);
9696

97+
console.log(`Signing key: ${JSON.stringify(signingKey)}`);
98+
9799
// Verify options
98100
const verifyOptions: VerifyOptions = {
99-
issuer: AuthConfig.jwt.issuer,
100-
audience: AuthConfig.jwt.audience,
101+
//issuer: AuthConfig.jwt.issuer,
102+
//audience: AuthConfig.jwt.audience,
101103
clockTolerance: AuthConfig.jwt.clockTolerance,
102104
ignoreExpiration: AuthConfig.jwt.ignoreExpiration,
103105
};
@@ -117,6 +119,7 @@ export class JwtService implements OnModuleInit {
117119
throw new UnauthorizedException('Invalid token');
118120
}
119121

122+
console.log(`Decoded token: ${JSON.stringify(decodedToken)}`);
120123
const user: JwtUser = { isMachine: false };
121124

122125
// Check for M2M token from Auth0

0 commit comments

Comments
 (0)