From a67ec247f49ee8952d4634f3f39f9a24438afdef Mon Sep 17 00:00:00 2001 From: akki-ng Date: Tue, 31 Oct 2017 16:21:24 +0530 Subject: [PATCH] Correct PrinciplaType for multiple extension of User models --- lib/access-context.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/access-context.js b/lib/access-context.js index 0040020c..be291bfa 100644 --- a/lib/access-context.js +++ b/lib/access-context.js @@ -88,7 +88,9 @@ function AccessContext(context) { var token = this.accessToken || {}; if (token.userId) { - this.addPrincipal(Principal.USER, token.userId); + var userPrincipalType = + (this.accessToken && this.accessToken.principalType) || Principal.USER; + this.addPrincipal(userPrincipalType, token.userId); } if (token.appId) { this.addPrincipal(Principal.APPLICATION, token.appId);