@accounts/client
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -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", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6
50834
1207
1
+ Added@accounts/common@0.0.4(transitive)
- Removedapollo-errors@^1.2.1
- Removed@accounts/common@0.0.3(transitive)
- Removedapollo-errors@1.9.0(transitive)
- Removedassert@1.5.1(transitive)
- Removedcall-bind@1.0.7(transitive)
- Removeddefine-data-property@1.1.4(transitive)
- Removeddefine-properties@1.2.1(transitive)
- Removedes-define-property@1.0.0(transitive)
- Removedes-errors@1.3.0(transitive)
- Removedextendable-error@0.1.7(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedget-intrinsic@1.2.4(transitive)
- Removedgopd@1.0.1(transitive)
- Removedhas-property-descriptors@1.0.2(transitive)
- Removedhas-proto@1.0.3(transitive)
- Removedhas-symbols@1.0.3(transitive)
- Removedhasown@2.0.2(transitive)
- Removedinherits@2.0.3(transitive)
- Removedobject-keys@1.1.1(transitive)
- Removedobject.assign@4.1.5(transitive)
- Removedset-function-length@1.2.2(transitive)
- Removedutil@0.10.4(transitive)
Updated@accounts/common@^0.0.4