search-client
Version:
Javascript library for executing searches in the Haive search-index via the SearchManager REST interface.
22 lines • 901 B
JavaScript
import { JwtAuthentication } from './JwtAuthentication';
import { OidcAuthentication } from './OidcAuthentication';
var AuthenticationFactory = /** @class */ (function () {
function AuthenticationFactory() {
}
AuthenticationFactory.prototype.create = function (settings, auth, fetchMethod) {
if (settings.type === 'oidc') {
var oidcAuthentication = new OidcAuthentication(settings, auth, fetchMethod);
return oidcAuthentication;
}
else if (settings.type === 'jwt') {
var jwtAuthentication = new JwtAuthentication(settings, auth, fetchMethod);
return jwtAuthentication;
}
else {
throw new Error('Select either a OIDC or a JWT authentication type.');
}
};
return AuthenticationFactory;
}());
export { AuthenticationFactory };
//# sourceMappingURL=AuthenticationFactory.js.map