import { IIdentity } from "../../"; import ServiceBase from "../base/service-base"; export default class IdentityService extends ServiceBase { private bcrypt; private jwt; private TOKEN_SECRET; private SALT; private EXPIRES_IN; constructor(bcrypt: any, jwt: any, TOKEN_SECRET: string, SALT: string, EXPIRES_IN: number, USER: any); private userMappedFields; MapUserField(field: string): void; Create(payload: any): Promise; /** * Attempts to login with username and password * @param username * @param password * @returns JWT (bearer token) */ DoLogin(username: string, password: string): Promise; /** * Generates a encrypted password * @param password Password to be encrypted * @returns Encrypted password */ GeneratePassword: (password: string) => Promise; /** * Attempts to change user password * @param userId - User Identifier to be updated * @param password - Old Password * @param newPassword - New Password * @returns true if modified, otherwise false */ ChangePassword: (userId: string, oldPassword: string, newPassword: string) => Promise; }