architect-sdk
Version:
Essentialz Architect SDK
39 lines (38 loc) • 1.66 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.GoogleProvider = void 0;
var errors_1 = require("../../errors");
var BaseProvider_1 = require("./BaseProvider");
var types_1 = require("../types");
var GoogleProvider = /** @class */ (function (_super) {
__extends(GoogleProvider, _super);
function GoogleProvider(httpClient) {
return _super.call(this, types_1.ArchitectAuthProvider.Google, httpClient) || this;
}
GoogleProvider.prototype.validateCredentials = function (credentials) {
var idToken = credentials.idToken;
if (!idToken
|| !idToken.length) {
throw new errors_1.ArchitectError(this.formatErrorMessage(credentials, {
idToken: 'string',
}));
}
};
return GoogleProvider;
}(BaseProvider_1.BaseProvider));
exports.GoogleProvider = GoogleProvider;