Skip to content

Commit 01d9e14

Browse files
authored
perf(index): use optional chaining (#282)
Signed-off-by: Frazer Smith <[email protected]>
1 parent fa3abda commit 01d9e14

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
'use strict'
2+
23
const url = require('node:url')
34
const http = require('node:http')
45
const https = require('node:https')
@@ -155,7 +156,7 @@ function fastifyOauth2 (fastify, options, next) {
155156
}
156157
}
157158
}
158-
const generateCallbackUriParams = (credentials.auth && credentials.auth[kGenerateCallbackUriParams]) || defaultGenerateCallbackUriParams
159+
const generateCallbackUriParams = credentials.auth?.[kGenerateCallbackUriParams] || defaultGenerateCallbackUriParams
159160
const cookieOpts = Object.assign({ httpOnly: true, sameSite: 'lax' }, options.cookie)
160161

161162
const generateStateFunctionCallbacked = function (request, callback) {

0 commit comments

Comments
 (0)