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.30 to 0.4.0-alpha.0

LICENSE

8

lib/accounts-server.d.ts

@@ -15,3 +15,3 @@ import * as Emittery from 'emittery';

};
emailTemplates: import("./types/email-templates-type").EmailTemplatesType;
emailTemplates: import("@accounts/server/src/types/email-templates-type").EmailTemplatesType;
userObjectSanitizer: (user: User) => User;

@@ -74,3 +74,7 @@ sendMail: (mail: object) => Promise<void>;

*/
createTokens(token: string, isImpersonated?: boolean): Tokens;
createTokens({ token, isImpersonated, userId, }: {
token: string;
isImpersonated?: boolean;
userId: string;
}): Tokens;
/**

@@ -77,0 +81,0 @@ * @description Logout a user and invalidate his session.

@@ -177,3 +177,6 @@ "use strict";

sessionId = _b.sent();
_a = this.createTokens(token), accessToken = _a.accessToken, refreshToken = _a.refreshToken;
_a = this.createTokens({
token: token,
userId: user.id,
}), accessToken = _a.accessToken, refreshToken = _a.refreshToken;
return [2 /*return*/, {

@@ -264,3 +267,7 @@ sessionId: sessionId,

newSessionId = _a.sent();
impersonationTokens = this.createTokens(newSessionId, true);
impersonationTokens = this.createTokens({
token: newSessionId,
isImpersonated: true,
userId: user.id,
});
impersonationResult = {

@@ -327,3 +334,3 @@ authorized: true,

}
tokens = this.createTokens(sessionToken);
tokens = this.createTokens({ token: sessionToken, userId: user.id });
return [4 /*yield*/, this.db.updateSession(session.id, { ip: ip, userAgent: userAgent })];

@@ -356,8 +363,9 @@ case 3:

*/
AccountsServer.prototype.createTokens = function (token, isImpersonated) {
if (isImpersonated === void 0) { isImpersonated = false; }
var _a = this.options, tokenSecret = _a.tokenSecret, tokenConfigs = _a.tokenConfigs;
AccountsServer.prototype.createTokens = function (_a) {
var token = _a.token, _b = _a.isImpersonated, isImpersonated = _b === void 0 ? false : _b, userId = _a.userId;
var _c = this.options, tokenSecret = _c.tokenSecret, tokenConfigs = _c.tokenConfigs;
var jwtData = {
token: token,
isImpersonated: isImpersonated,
userId: userId,
};

@@ -364,0 +372,0 @@ var accessToken = tokens_1.generateAccessToken({

@@ -9,3 +9,3 @@ import * as jwt from 'jsonwebtoken';

export interface AccountsServerOptions {
db: DatabaseInterface;
db?: DatabaseInterface;
tokenSecret: string;

@@ -12,0 +12,0 @@ tokenConfigs?: {

export interface JwtData {
token: string;
isImpersonated: boolean;
userId: string;
}
{
"name": "@accounts/server",
"version": "0.3.0-beta.30",
"version": "0.4.0-alpha.0",
"description": "Fullstack authentication and accounts-management",

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

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

@@ -63,3 +63,4 @@ "emittery": "0.4.1",

"rimraf": "2.6.2"
}
},
"gitHead": "bc3c2cc1f58401c94dbe9adace77832c4b60b3c0"
}

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