Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

kinvey-js-sdk

Package Overview
Dependencies
Maintainers
5
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kinvey-js-sdk - npm Package Compare versions

Comparing version 6.0.0-next.5 to 6.0.0

1

lib/user/index.d.ts

@@ -37,3 +37,2 @@ import { Query } from '../query';

timeout?: number;
state?: boolean;
}): Promise<KinveyUser>;

@@ -40,0 +39,0 @@ static signUpWithIdentity(): Promise<void>;

import { User } from './user';
export declare function signup(data?: object | User, options?: {
timeout?: number;
state?: boolean;
}): Promise<User>;

27

lib/user/signup.js

@@ -43,6 +43,4 @@ "use strict";

var isPlainObject_1 = __importDefault(require("lodash/isPlainObject"));
var activeUser_1 = require("../errors/activeUser");
var kinvey_1 = require("../errors/kinvey");
var http_1 = require("../http");
var getActiveUser_1 = require("./getActiveUser");
var user_1 = require("./user");

@@ -52,15 +50,9 @@ function signup(data, options) {

return __awaiter(this, void 0, void 0, function () {
var activeUser, _a, state, request, response, session;
return __generator(this, function (_b) {
switch (_b.label) {
case 0: return [4 /*yield*/, getActiveUser_1.getActiveUser()];
case 1:
activeUser = _b.sent();
_a = options.state, state = _a === void 0 ? true : _a;
var request, response, session;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (data && !isPlainObject_1.default(data)) {
throw new kinvey_1.KinveyError('The provided data must be an object.');
}
if (state === true && activeUser) {
throw new activeUser_1.ActiveUserError('An active user already exists. Please logout the active user before you signup.');
}
request = new http_1.KinveyHttpRequest({

@@ -79,11 +71,6 @@ method: http_1.HttpRequestMethod.POST,

return [4 /*yield*/, request.execute()];
case 2:
response = _b.sent();
case 1:
response = _a.sent();
session = response.data;
if (!(state === true)) return [3 /*break*/, 4];
return [4 /*yield*/, http_1.setSession(session)];
case 3:
_b.sent();
_b.label = 4;
case 4: return [2 /*return*/, new user_1.User(session)];
return [2 /*return*/, new user_1.User(session)];
}

@@ -90,0 +77,0 @@ });

{
"name": "kinvey-js-sdk",
"description": "Kinvey JavaScript SDK for JavaScript applications.",
"version": "6.0.0-next.5",
"version": "6.0.0",
"license": "Apache-2.0",

@@ -21,3 +21,3 @@ "keywords": [

"js-base64": "2.5.1",
"lodash": "4.17.21",
"lodash": "4.17.15",
"loglevel": "1.6.3",

@@ -24,0 +24,0 @@ "loglevel-plugin-prefix": "0.8.4",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc