Skip to content

Commit

Permalink
N21-1374 uses optional chaining
Browse files Browse the repository at this point in the history
  • Loading branch information
arnegns committed Nov 9, 2023
1 parent 61bfe2e commit 2497112
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class OauthSSOController {
): Promise<AuthorizationParams> {
let jwt: string;
const authHeader: string | undefined = req.headers.authorization;
if (authHeader && authHeader.toLowerCase().startsWith('bearer ')) {
if (authHeader?.toLowerCase()?.startsWith('bearer ')) {
[, jwt] = authHeader.split(' ');
} else {
throw new UnauthorizedException(
Expand Down

0 comments on commit 2497112

Please sign in to comment.