@accounts/server
Advanced tools
Comparing version 0.25.1 to 0.25.3
@@ -23,9 +23,9 @@ import Emittery from 'emittery'; | ||
}; | ||
export declare class AccountsServer { | ||
options: AccountsServerOptions & typeof defaultOptions; | ||
export declare class AccountsServer<CustomUser extends User = User> { | ||
options: AccountsServerOptions<CustomUser> & typeof defaultOptions; | ||
private services; | ||
private db; | ||
private hooks; | ||
constructor(options: AccountsServerOptions, services: { | ||
[key: string]: AuthenticationService; | ||
constructor(options: AccountsServerOptions<CustomUser>, services: { | ||
[key: string]: AuthenticationService<CustomUser>; | ||
}); | ||
@@ -64,3 +64,3 @@ getServices(): { | ||
*/ | ||
loginWithUser(user: User, infos: ConnectionInformations): Promise<LoginResult>; | ||
loginWithUser(user: CustomUser, infos: ConnectionInformations): Promise<LoginResult>; | ||
/** | ||
@@ -109,3 +109,3 @@ * @description Impersonate to another user. | ||
*/ | ||
resumeSession(accessToken: string): Promise<User>; | ||
resumeSession(accessToken: string): Promise<CustomUser>; | ||
/** | ||
@@ -123,3 +123,3 @@ * @description Find a session by his token. | ||
*/ | ||
findUserById(userId: string): Promise<User | null>; | ||
findUserById(userId: string): Promise<CustomUser | null>; | ||
/** | ||
@@ -137,4 +137,4 @@ * @description Deactivate a user, the user will not be able to login until his account is reactivated. | ||
activateUser(userId: string): Promise<void>; | ||
prepareMail(to: string, token: string, user: User, pathFragment: string, emailTemplate: EmailTemplateType, from: string): any; | ||
sanitizeUser(user: User): User; | ||
prepareMail(to: string, token: string, user: CustomUser, pathFragment: string, emailTemplate: EmailTemplateType, from: string): any; | ||
sanitizeUser(user: CustomUser): CustomUser; | ||
private internalUserSanitizer; | ||
@@ -141,0 +141,0 @@ private defaultPrepareEmail; |
@@ -40,3 +40,3 @@ "use strict"; | ||
if (this.options.ambiguousErrorMessages && this.options.enableAutologin) { | ||
throw new Error("Can't enable autologin when ambiguous error messages are enabled (https://accounts-js.netlify.com/docs/api/server/globals#ambiguouserrormessages).\nPlease set ambiguousErrorMessages to false to be able to use autologin."); | ||
throw new Error("Can't enable autologin when ambiguous error messages are enabled (https://www.accountsjs.com/docs/api/server/globals#ambiguouserrormessages).\nPlease set ambiguousErrorMessages to false to be able to use autologin."); | ||
} | ||
@@ -43,0 +43,0 @@ this.services = services || {}; |
@@ -9,3 +9,3 @@ import * as jwt from 'jsonwebtoken'; | ||
import { TokenCreator } from './token-creator'; | ||
export interface AccountsServerOptions { | ||
export interface AccountsServerOptions<CustomUser extends User = User> { | ||
/** | ||
@@ -15,3 +15,3 @@ * Return ambiguous error messages from login failures to prevent user enumeration. Defaults to true. | ||
ambiguousErrorMessages?: boolean; | ||
db?: DatabaseInterface; | ||
db?: DatabaseInterface<CustomUser>; | ||
tokenSecret: string | { | ||
@@ -18,0 +18,0 @@ publicKey: jwt.Secret; |
@@ -38,3 +38,3 @@ "use strict"; | ||
console.warn('No configuration for email, you must set an email configuration'); | ||
console.warn('Documentation: https://accounts-js.netlify.com/docs/email'); | ||
console.warn('Documentation: https://www.accountsjs.com/docs/email'); | ||
console.log(mail); | ||
@@ -41,0 +41,0 @@ return [2 /*return*/]; |
{ | ||
"name": "@accounts/server", | ||
"version": "0.25.1", | ||
"version": "0.25.3", | ||
"description": "Fullstack authentication and accounts-management", | ||
@@ -43,4 +43,4 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@accounts/types": "^0.25.1", | ||
"@types/jsonwebtoken": "8.3.5", | ||
"@accounts/types": "^0.25.3", | ||
"@types/jsonwebtoken": "8.3.9", | ||
"emittery": "0.5.1", | ||
@@ -50,12 +50,12 @@ "jsonwebtoken": "8.5.1", | ||
"lodash": "4.17.15", | ||
"tslib": "1.10.0" | ||
"tslib": "1.11.2" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "25.1.4", | ||
"@types/jest": "25.2.1", | ||
"@types/jwt-decode": "2.2.1", | ||
"@types/node": "13.9.8", | ||
"jest": "25.1.0", | ||
"rimraf": "3.0.0" | ||
"@types/node": "13.13.5", | ||
"jest": "26.0.1", | ||
"rimraf": "3.0.2" | ||
}, | ||
"gitHead": "18c02edee2a382236923b4b6c221362dba3c7bb9" | ||
"gitHead": "77c35ef4c767555f10aed242e2032a17130af0bf" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
79888
+ Added@types/jsonwebtoken@8.3.9(transitive)
- Removed@types/jsonwebtoken@8.3.5(transitive)
- Removedtslib@1.10.0(transitive)
Updated@accounts/types@^0.25.3
Updated@types/jsonwebtoken@8.3.9
Updatedtslib@1.11.2