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

@accounts/client

Package Overview
Dependencies
Maintainers
4
Versions
201
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@accounts/client - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

30

lib/AccountsClient.js

@@ -55,5 +55,3 @@ 'use strict';

if (!transport) {
throw new _common.AccountsError({
message: 'A REST or GraphQL transport is required'
});
throw new _common.AccountsError('A REST or GraphQL transport is required');
}

@@ -161,3 +159,3 @@

this.clearUser();
throw new _common.AccountsError({ message: 'falsy token provided' });
throw new _common.AccountsError('falsy token provided');

@@ -200,3 +198,6 @@ case 23:

throw new _common.AccountsError({ message: 'Unrecognized options for create user request [400]' });
throw new _common.AccountsError('Unrecognized options for create user request', {
username: user && user.username,
email: user && user.email
}, 400);

@@ -209,3 +210,3 @@ case 2:

throw new _common.AccountsError({ message: 'Password is required' });
throw new _common.AccountsError('Password is required');

@@ -218,3 +219,3 @@ case 4:

throw new _common.AccountsError({ message: 'Username or Email is required' });
throw new _common.AccountsError('Username or Email is required');

@@ -246,3 +247,3 @@ case 6:

}
throw new _common.AccountsError({ message: _context2.t0.message });
throw new _common.AccountsError(_context2.t0.message);

@@ -277,3 +278,3 @@ case 19:

throw new _common.AccountsError({ message: 'Unrecognized options for login request [400]' });
throw new _common.AccountsError('Unrecognized options for login request', user, 400);

@@ -286,3 +287,3 @@ case 2:

throw new _common.AccountsError({ message: 'Match failed [400]' });
throw new _common.AccountsError('Match failed', user, 400);

@@ -316,6 +317,6 @@ case 4:

}
throw new _common.AccountsError({ message: _context3.t0.message });
throw new _common.AccountsError(_context3.t0.message);
case 20:
this.store.dispatch((0, _module.loggingIn)(false));
this.store.dispatch((0, _module.loggingIn)(false), user);

@@ -358,4 +359,2 @@ case 21:

_tokens2 = this.tokens(), accessToken = _tokens2.accessToken;
// $FlowFixMe
_context4.next = 4;

@@ -381,3 +380,3 @@ return this.transport.logout(accessToken);

}
throw new _common.AccountsError({ message: _context4.t0.message });
throw new _common.AccountsError(_context4.t0.message);

@@ -434,3 +433,2 @@ case 14:

resumeSession: function resumeSession() {
// $FlowFixMe
return this.instance.resumeSession();

@@ -437,0 +435,0 @@ },

@@ -53,4 +53,3 @@ 'use strict';

} catch (err) {
var _err$serialize = err.serialize(),
message = _err$serialize.message;
var message = err.message;

@@ -70,4 +69,3 @@ expect(message).toEqual('A REST or GraphQL transport is required');

it('requires user object', _asyncToGenerator(regeneratorRuntime.mark(function _callee() {
var _err$serialize2, message;
var message;
return regeneratorRuntime.wrap(function _callee$(_context) {

@@ -92,5 +90,5 @@ while (1) {

_context.t0 = _context['catch'](1);
_err$serialize2 = _context.t0.serialize(), message = _err$serialize2.message;
message = _context.t0.message;
expect(message).toEqual('Unrecognized options for create user request [400]');
expect(message).toEqual('Unrecognized options for create user request');

@@ -105,4 +103,3 @@ case 11:

it('requires password', _asyncToGenerator(regeneratorRuntime.mark(function _callee2() {
var _err$serialize3, message;
var message;
return regeneratorRuntime.wrap(function _callee2$(_context2) {

@@ -129,3 +126,3 @@ while (1) {

_context2.t0 = _context2['catch'](1);
_err$serialize3 = _context2.t0.serialize(), message = _err$serialize3.message;
message = _context2.t0.message;

@@ -142,4 +139,3 @@ expect(message).toEqual('Password is required');

it('requires username or an email', _asyncToGenerator(regeneratorRuntime.mark(function _callee3() {
var _err$serialize4, message;
var message;
return regeneratorRuntime.wrap(function _callee3$(_context3) {

@@ -166,3 +162,3 @@ while (1) {

_context3.t0 = _context3['catch'](1);
_err$serialize4 = _context3.t0.serialize(), message = _err$serialize4.message;
message = _context3.t0.message;

@@ -291,4 +287,3 @@ expect(message).toEqual('Username or Email is required');

it('throws error if password is undefined', _asyncToGenerator(regeneratorRuntime.mark(function _callee7() {
var transport, _err$serialize5, message;
var transport, message;
return regeneratorRuntime.wrap(function _callee7$(_context7) {

@@ -315,5 +310,5 @@ while (1) {

_context7.t0 = _context7['catch'](2);
_err$serialize5 = _context7.t0.serialize(), message = _err$serialize5.message;
message = _context7.t0.message;
expect(message).toEqual('Unrecognized options for login request [400]');
expect(message).toEqual('Unrecognized options for login request');

@@ -328,4 +323,3 @@ case 12:

it('throws error if user is undefined', _asyncToGenerator(regeneratorRuntime.mark(function _callee8() {
var transport, _err$serialize6, message;
var transport, message;
return regeneratorRuntime.wrap(function _callee8$(_context8) {

@@ -352,5 +346,5 @@ while (1) {

_context8.t0 = _context8['catch'](2);
_err$serialize6 = _context8.t0.serialize(), message = _err$serialize6.message;
message = _context8.t0.message;
expect(message).toEqual('Unrecognized options for login request [400]');
expect(message).toEqual('Unrecognized options for login request');

@@ -365,4 +359,3 @@ case 12:

it('throws error user is not a string or is an empty object', _asyncToGenerator(regeneratorRuntime.mark(function _callee9() {
var transport, _err$serialize7, message;
var transport, message;
return regeneratorRuntime.wrap(function _callee9$(_context9) {

@@ -389,5 +382,5 @@ while (1) {

_context9.t0 = _context9['catch'](2);
_err$serialize7 = _context9.t0.serialize(), message = _err$serialize7.message;
message = _context9.t0.message;
expect(message).toEqual('Match failed [400]');
expect(message).toEqual('Match failed');

@@ -402,4 +395,3 @@ case 12:

it('throws error password is not a string', _asyncToGenerator(regeneratorRuntime.mark(function _callee10() {
var transport, _err$serialize8, message;
var transport, message;
return regeneratorRuntime.wrap(function _callee10$(_context10) {

@@ -426,5 +418,5 @@ while (1) {

_context10.t0 = _context10['catch'](2);
_err$serialize8 = _context10.t0.serialize(), message = _err$serialize8.message;
message = _context10.t0.message;
expect(message).toEqual('Match failed [400]');
expect(message).toEqual('Match failed');

@@ -663,3 +655,3 @@ case 12:

expect(_context18.t0.serialize().message).toEqual('error message');
expect(_context18.t0.message).toEqual('error message');
expect(callback.mock.calls.length).toEqual(1);

@@ -709,4 +701,3 @@ expect(callback.mock.calls[0][0]).toEqual({ message: 'error message' });

it('clears tokens, users and throws error if bad refresh token provided', _asyncToGenerator(regeneratorRuntime.mark(function _callee20() {
var _err$serialize9, message;
var message;
return regeneratorRuntime.wrap(function _callee20$(_context20) {

@@ -735,3 +726,3 @@ while (1) {

_context20.t0 = _context20['catch'](5);
_err$serialize9 = _context20.t0.serialize(), message = _err$serialize9.message;
message = _context20.t0.message;

@@ -738,0 +729,0 @@ expect(message).toEqual('falsy token provided');

{
"name": "@accounts/client",
"version": "0.0.3",
"version": "0.0.4",
"description": "Fullstack authentication and accounts-management",

@@ -12,3 +12,2 @@ "main": "lib/index.js",

"compile": "babel ./src --out-dir ./lib",
"flow:check": "flow check",
"prepublish": "npm run compile",

@@ -23,3 +22,6 @@ "test": "npm run testonly",

"testEnvironment": "node",
"testRegex": "(/.*.(test|spec)).(js|jsx)$"
"testRegex": "(/.*.(test|spec)).(js|jsx)$",
"testPathDirs": [
"src"
]
},

@@ -63,4 +65,3 @@ "repository": {

"dependencies": {
"@accounts/common": "^0.0.3",
"apollo-errors": "^1.2.1",
"@accounts/common": "^0.0.4",
"immutable": "^3.8.1",

@@ -67,0 +68,0 @@ "jwt-decode": "^2.1.0",

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