mirror of
https://github.com/jambonz/jambonz-api-server.git
synced 2026-11-08 20:43:46 +00:00
added more authentication tests
This commit is contained in:
1 parent
ce587d828f
commit
c95a9ebaf7
7 files changed
+319
-23
No files matched your search
+4
-1
@@ -41,7 +41,10 @@ function makeStrategy(logger) {
|
||||
const user = {
|
||||
account_sid: results[0].account_sid,
|
||||
service_provider_sid: results[0].service_provider_sid,
|
||||
hasScope: (s) => scope.includes(s)
|
||||
hasScope: (s) => scope.includes(s),
|
||||
hasAdminAuth: scope.length === 3,
|
||||
hasServiceProviderAuth: scope.includes('service_provider') && !scope.includes('admin'),
|
||||
hasAccountAuth: scope.includes('account') && !scope.includes('service_provider')
|
||||
};
|
||||
logger.info(user, `successfully validated with scope ${scope}`);
|
||||
return done(null, user, {scope});
|
||||
|
||||
Reference in new issue
Block a user