UNPKG

@arc-publishing/sdk-identity

Version:
22 lines 981 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); var socialSignOn_1 = require("./socialSignOn"); var socialSignOnTypes_1 = require("./socialSignOnTypes"); function signInWithGoogle(response) { return tslib_1.__awaiter(this, void 0, void 0, function () { return tslib_1.__generator(this, function (_a) { switch (_a.label) { case 0: if (!(0, socialSignOnTypes_1.isGoogleCredentialResponse)(response)) return [3, 2]; return [4, (0, socialSignOn_1.socialLogin)('google', { credentials: response.credential })]; case 1: return [2, _a.sent()]; case 2: throw new Error("[Arc Identity SDK]: Error getting google jwt credential. ".concat(response)); } }); }); } exports.default = signInWithGoogle; //# sourceMappingURL=signInWithGoogle.js.map