Socket
Socket
Sign inDemoInstall

amelisa-auth

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

amelisa-auth - npm Package Compare versions

Comparing version 0.1.6 to 0.1.10

2

lib/api/authenticate.js

@@ -52,3 +52,3 @@ "use strict";

case 11:
return _context.abrupt("return", user.id);
return _context.abrupt("return", { userId: user.id });

@@ -55,0 +55,0 @@ case 12:

@@ -17,3 +17,3 @@ "use strict";

var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(secret, password) {
var _ref, data, info, user;
var _ref, data, info, user, result;

@@ -45,2 +45,15 @@ return _regenerator2.default.wrap(function _callee$(_context) {

case 10:
result = _context.sent;
if (!result) {
_context.next = 13;
break;
}
return _context.abrupt("return", result);
case 13:
return _context.abrupt("return", { user: user });
case 14:
case "end":

@@ -47,0 +60,0 @@ return _context.stop();

@@ -16,3 +16,3 @@ 'use strict';

function initCrypt() {
cryptModule = (0, _bcrypt2.default)(8);
cryptModule = (0, _bcrypt2.default)(this.options.encryptionStrength);
}

@@ -19,0 +19,0 @@

@@ -31,3 +31,3 @@ 'use strict';

encryption: 'bcryptjs', // 'bcryptjs' (js) or 'bcrypt' (native) or 'sha-1'
encryptionStrength: 10,
encryptionStrength: 8,
localField: 'local',

@@ -34,0 +34,0 @@ emailField: 'email',

@@ -16,3 +16,3 @@ "use strict";

var sendResetPassword = function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(secret, password) {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(email, password) {
return _regenerator2.default.wrap(function _callee$(_context) {

@@ -19,0 +19,0 @@ while (1) {

@@ -17,3 +17,3 @@ 'use strict';

var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(req) {
var _ref, data, info, email, password, userId;
var _ref, data, info, email, password, result, userId;

@@ -46,5 +46,5 @@ return _regenerator2.default.wrap(function _callee$(_context) {

case 11:
userId = _context.sent;
result = _context.sent;
if (userId) {
if (!(result && result.info)) {
_context.next = 14;

@@ -54,9 +54,21 @@ break;

return _context.abrupt('return', result);
case 14:
if (!(!result || !result.userId)) {
_context.next = 16;
break;
}
return _context.abrupt('return', { info: 'Wrong credentials' });
case 14:
_context.next = 16;
case 16:
userId = result.userId;
_context.next = 19;
return this.login(userId, req);
case 16:
case 19:
return _context.abrupt('return', { userId: userId });
case 20:
case 'end':

@@ -63,0 +75,0 @@ return _context.stop();

@@ -51,2 +51,5 @@ "use strict";

case 15:
return _context.abrupt("return", { userId: userId });
case 16:
case "end":

@@ -53,0 +56,0 @@ return _context.stop();

@@ -17,3 +17,3 @@ "use strict";

var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(req) {
var _ref, data, info, password, secret;
var _ref, data, info, password, secret, result, user;

@@ -43,8 +43,20 @@ return _regenerator2.default.wrap(function _callee$(_context) {

_context.next = 11;
return this.sendResetPassword(secret, password);
return this.resetPassword(secret, password);
case 11:
return _context.abrupt("return", this.resetPassword(secret, password));
result = _context.sent;
case 12:
if (!result.info) {
_context.next = 14;
break;
}
return _context.abrupt("return", { info: result.info });
case 14:
user = result.user;
_context.next = 17;
return this.sendResetPassword(user.email, password);
case 17:
case "end":

@@ -51,0 +63,0 @@ return _context.stop();

{
"name": "amelisa-auth",
"version": "0.1.6",
"version": "0.1.10",
"description": "Auth for Amelisa",

@@ -5,0 +5,0 @@ "main": "lib",

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