Skip to content

Commit

Permalink
remove jwt validation except basic structure, change CSP header value…
Browse files Browse the repository at this point in the history
… to unsafe-eval
  • Loading branch information
gmesserman committed Dec 31, 2020
1 parent 298144b commit e6e4d50
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/auth/jwt/jwt.token.with.rsa.keys.processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ export class JwtTokenWithRSAKeysProcessor extends JwtTokenProcessor {
this.log.debug('Call validateToken');

const [header, payload] = this.parse(token);
if (header.alg === 'None') {
return payload;
}
return decode(token, this.publicKey, false, header.alg);
// if (header.alg === 'None') {
// return payload;
// }
// return decode(token, this.publicKey, false, header.alg);
return payload;
}

async createToken(payload: unknown): Promise<string> {
Expand Down
2 changes: 1 addition & 1 deletion src/interceptors/headers.configurator.interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export class HeadersConfiguratorInterceptor implements NestInterceptor {
res.header(HeadersConfiguratorInterceptor.CONTENT_TYPE_OPTIONS, '1');
res.header(
HeadersConfiguratorInterceptor.CONTENT_SECURITY_POLICY,
'default-src *;',
'unsafe-eval',
);
}
}),
Expand Down

0 comments on commit e6e4d50

Please sign in to comment.