Language: JavaScript
Label: safe
CWE: CWE-346 \u2014 Origin Validation Error
The product does not properly verify that the source of data or communication is valid.

Code:
		sessionId: request.signedCookies ? request.signedCookies[nconf.get('sessionKey')] : null,
		request: request,
	});

	const sessionData = await getSessionAsync(sessionId);
	request.session = sessionData;
	let uid = 0;
	if (sessionData && sessionData.passport && sessionData.passport.user) {
		uid = parseInt(sessionData.passport.user, 10);
	}
	request.uid = uid;
	callback(null, uid);
}