Bound SSOAdapter methods to their instance

no-issue

This allows custom SSO adapters to store instance config and refer to
in their methods
This commit is contained in:
Fabien O'Carroll 2020-11-05 13:07:56 +00:00
parent aface9ed4c
commit 0ce8e3171b

View File

@ -43,7 +43,7 @@ const ssoAdapter = adapterManager.getAdapter('sso');
module.exports.createSessionFromToken = sessionFromToken({
callNextWithError: false,
createSession: sessionService.createSessionForUser,
findUserByLookup: ssoAdapter.getUserForIdentity,
getLookupFromToken: ssoAdapter.getIdentityFromCredentials,
getTokenFromRequest: ssoAdapter.getRequestCredentials
findUserByLookup: ssoAdapter.getUserForIdentity.bind(ssoAdapter),
getLookupFromToken: ssoAdapter.getIdentityFromCredentials.bind(ssoAdapter),
getTokenFromRequest: ssoAdapter.getRequestCredentials.bind(ssoAdapter)
});