New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@accounts/server

Package Overview
Dependencies
Maintainers
5
Versions
204
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@accounts/server - npm Package Compare versions

Comparing version 0.3.0-beta.29 to 0.3.0-beta.30

12

lib/accounts-server.d.ts

@@ -108,2 +108,14 @@ import * as Emittery from 'emittery';

updateProfile(userId: string, profile: object): Promise<object>;
/**
* @description Deactivate a user, the user will not be able to login until his account is reactivated.
* @param {string} userId - User id.
* @returns {Promise<void>} - Return a Promise.
*/
deactivateUser(userId: string): Promise<void>;
/**
* @description Activate a user.
* @param {string} userId - User id.
* @returns {Promise<void>} - Return a Promise.
*/
activateUser(userId: string): Promise<void>;
prepareMail(to: string, token: string, user: User, pathFragment: string, emailTemplate: EmailTemplateType, from: string): any;

@@ -110,0 +122,0 @@ sanitizeUser(user: User): User;

29

lib/accounts-server.js

@@ -128,6 +128,9 @@ "use strict";

user = _a.sent();
hooksInfo.user = user;
if (!user) {
throw new Error("Service " + serviceName + " was not able to authenticate user");
}
hooksInfo.user = user;
if (user.deactivated) {
throw new Error('Your account has been deactivated');
}
// Let the user validate the login attempt

@@ -535,2 +538,26 @@ return [4 /*yield*/, this.hooks.emitSerial(server_hooks_1.ServerHooks.ValidateLogin, hooksInfo)];

};
/**
* @description Deactivate a user, the user will not be able to login until his account is reactivated.
* @param {string} userId - User id.
* @returns {Promise<void>} - Return a Promise.
*/
AccountsServer.prototype.deactivateUser = function (userId) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this.db.setUserDeactivated(userId, true)];
});
});
};
/**
* @description Activate a user.
* @param {string} userId - User id.
* @returns {Promise<void>} - Return a Promise.
*/
AccountsServer.prototype.activateUser = function (userId) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this.db.setUserDeactivated(userId, false)];
});
});
};
AccountsServer.prototype.prepareMail = function (to, token, user, pathFragment, emailTemplate, from) {

@@ -537,0 +564,0 @@ if (this.options.prepareMail) {

4

package.json
{
"name": "@accounts/server",
"version": "0.3.0-beta.29",
"version": "0.3.0-beta.30",
"description": "Fullstack authentication and accounts-management",

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

"dependencies": {
"@accounts/types": "^0.3.0-beta.29",
"@accounts/types": "^0.3.0-beta.30",
"@types/jsonwebtoken": "7.2.8",

@@ -52,0 +52,0 @@ "emittery": "0.4.1",

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