@arc-publishing/sdk-identity
Version:
JS Identity SDK for working with Identity API
19 lines • 844 B
JavaScript
import { __awaiter, __generator } from "tslib";
import { socialLogin } from './socialSignOn';
import { isGoogleCredentialResponse } from './socialSignOnTypes';
export default function signInWithGoogle(response) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!isGoogleCredentialResponse(response)) return [3, 2];
return [4, 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));
}
});
});
}
//# sourceMappingURL=signInWithGoogle.js.map