nest-keycloak-connect
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -44,8 +44,13 @@ "use strict"; | ||
const jwt = (_a = this.extractJwtFromCookie(request.cookies)) !== null && _a !== void 0 ? _a : this.extractJwt(request.headers); | ||
const result = yield this.keycloak.grantManager.validateAccessToken(jwt); | ||
if (typeof result === 'string') { | ||
request.user = yield this.keycloak.grantManager.userInfo(jwt); | ||
request.accessTokenJWT = jwt; | ||
return true; | ||
try { | ||
const result = yield this.keycloak.grantManager.validateAccessToken(jwt); | ||
if (typeof result === 'string') { | ||
request.user = yield this.keycloak.grantManager.userInfo(jwt); | ||
request.accessTokenJWT = jwt; | ||
return true; | ||
} | ||
} | ||
catch (ex) { | ||
console.error(`validateAccessToken Error: `, ex); | ||
} | ||
throw new common_1.UnauthorizedException(); | ||
@@ -65,6 +70,3 @@ }); | ||
extractJwtFromCookie(cookies) { | ||
if (cookies) { | ||
return cookies[this.keycloakOpts.cookieKey] || cookies.KEYCLOAK_JWT; | ||
} | ||
return null; | ||
return cookies && cookies[this.keycloakOpts.cookieKey] || cookies && cookies.KEYCLOAK_JWT; | ||
} | ||
@@ -71,0 +73,0 @@ }; |
{ | ||
"name": "nest-keycloak-connect", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "keycloak-nodejs-connect module for Nest", | ||
@@ -8,3 +8,4 @@ "author": "John Joshua Ferrer <johnjoshuaferrer@disroot.org>", | ||
"IERomanov <i.e.romanov1997@gmail.com>", | ||
"Jeff Tian <jeff.tian@outlook.com>" | ||
"Jeff Tian <jeff.tian@outlook.com>", | ||
"EFritzsche90" | ||
], | ||
@@ -11,0 +12,0 @@ "license": "MIT", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29251
458