Huge News!Announcing our $40M Series B led by Abstract Ventures.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.33.0 to 0.33.1

6

lib/accounts-server.d.ts

@@ -0,1 +1,2 @@

import * as jwt from 'jsonwebtoken';
import Emittery from 'emittery';

@@ -7,3 +8,6 @@ import { User, LoginResult, Tokens, Session, ImpersonationUserIdentity, ImpersonationResult, HookListener, AuthenticationService, ConnectionInformations } from '@accounts/types';

ambiguousErrorMessages: boolean;
tokenSecret: string;
tokenSecret: string | {
publicKey: jwt.Secret;
privateKey: jwt.Secret;
};
tokenConfigs: {

@@ -10,0 +14,0 @@ accessToken: {

2

lib/index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AccountsServer = void 0;
exports.AccountsServer = exports.ResumeSessionErrors = exports.LogoutErrors = exports.RefreshTokensErrors = exports.FindSessionByAccessTokenErrors = exports.ImpersonateErrors = exports.LoginWithServiceErrors = exports.AuthenticateWithServiceErrors = exports.AccountsJsError = exports.ServerHooks = exports.getFirstUserEmail = exports.generateRandomToken = void 0;
const accounts_server_1 = require("./accounts-server");

@@ -5,0 +5,0 @@ Object.defineProperty(exports, "AccountsServer", { enumerable: true, get: function () { return accounts_server_1.AccountsServer; } });

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

};
emailTemplates?: EmailTemplatesType;
emailTemplates?: Partial<EmailTemplatesType>;
userObjectSanitizer?: (user: CustomUser) => CustomUser;

@@ -25,0 +25,0 @@ impersonationAuthorize?: (user: User, impersonateToUser: User) => Promise<any>;

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

};
exports.sendMail = async (mail) => {
const sendMail = async (mail) => {
console.warn('No configuration for email, you must set an email configuration');

@@ -38,2 +38,3 @@ console.warn('Documentation: https://www.accountsjs.com/docs/email');

};
exports.sendMail = sendMail;
//# sourceMappingURL=email.js.map

@@ -10,5 +10,8 @@ "use strict";

*/
exports.generateRandomToken = (length = 43) => crypto_1.randomBytes(length).toString('hex');
exports.generateAccessToken = ({ secret, payload = {}, config, }) => jwt.sign(payload, secret, config);
exports.generateRefreshToken = ({ secret, payload = {}, config, }) => jwt.sign(payload, secret, config);
const generateRandomToken = (length = 43) => crypto_1.randomBytes(length).toString('hex');
exports.generateRandomToken = generateRandomToken;
const generateAccessToken = ({ secret, payload = {}, config, }) => jwt.sign(payload, secret, config);
exports.generateAccessToken = generateAccessToken;
const generateRefreshToken = ({ secret, payload = {}, config, }) => jwt.sign(payload, secret, config);
exports.generateRefreshToken = generateRefreshToken;
//# sourceMappingURL=tokens.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isString = void 0;
exports.isString = (x) => {
const isString = (x) => {
return typeof x === 'string';
};
exports.isString = isString;
//# sourceMappingURL=validation.js.map
{
"name": "@accounts/server",
"version": "0.33.0",
"version": "0.33.1",
"description": "Fullstack authentication and accounts-management",

@@ -10,14 +10,2 @@ "main": "lib/index.js",

},
"scripts": {
"clean": "rimraf lib",
"start": "tsc --watch",
"precompile": "yarn clean",
"compile": "tsc",
"prepublishOnly": "yarn compile",
"test": "npm run testonly",
"test-ci": "npm lint && npm coverage",
"testonly": "jest",
"test:watch": "jest --watch",
"coverage": "npm run testonly -- --coverage"
},
"files": [

@@ -48,3 +36,3 @@ "src",

"dependencies": {
"@accounts/types": "^0.33.0",
"@accounts/types": "^0.33.1",
"@types/jsonwebtoken": "8.3.9",

@@ -55,13 +43,23 @@ "emittery": "0.8.1",

"lodash.merge": "4.6.2",
"tslib": "2.1.0"
"tslib": "2.3.0"
},
"devDependencies": {
"@types/jest": "25.2.3",
"@types/jest": "26.0.24",
"@types/lodash.merge": "4.6.6",
"@types/node": "14.0.14",
"jest": "26.6.3",
"@types/node": "16.4.13",
"jest": "27.0.6",
"rimraf": "3.0.2",
"ts-jest": "26.5.0"
"ts-jest": "27.0.4"
},
"gitHead": "2703f3ef8c11803f584c9560affcae50ef7d830d"
}
"scripts": {
"clean": "rimraf lib",
"start": "tsc --watch",
"precompile": "pnpm run clean",
"compile": "tsc",
"test": "npm run testonly",
"test-ci": "npm lint && npm coverage",
"testonly": "jest",
"test:watch": "jest --watch",
"coverage": "npm run testonly -- --coverage"
}
}

@@ -40,3 +40,8 @@ import merge from 'lodash.merge';

ambiguousErrorMessages: true,
tokenSecret: 'secret',
tokenSecret: 'secret' as
| string
| {
publicKey: jwt.Secret;
privateKey: jwt.Secret;
},
tokenConfigs: {

@@ -43,0 +48,0 @@ accessToken: {

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

};
emailTemplates?: EmailTemplatesType;
emailTemplates?: Partial<EmailTemplatesType>;
userObjectSanitizer?: (user: CustomUser) => CustomUser;

@@ -28,0 +28,0 @@ impersonationAuthorize?: (user: User, impersonateToUser: User) => Promise<any>;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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