User

Hierarchy

  • User

Indexable

[key: string]: any

Constructors

Properties

_attributes?: any
api_token?: null | string
disabled: boolean
email: string
id?: number
language?: string
last_mobile_login?: null | Date
password: string
reset_password_expiry?: null | Date
reset_password_token?: null | string
role_id: number
verification_token?: string
verified_on?: Date

Accessors

Methods

  • Change password

    Parameters

    • newpw: string

      new password string

    • Optional expireToken: boolean

      if true than force reset password token

    Returns Promise<void>

    no result

  • Parameters

    • Optional req: any
    • Optional opts: {
          new_verification_token?: string;
      }
      • Optional new_verification_token?: string

    Returns Promise<any>

  • Set language for User in database

    Parameters

    • language: string

    Returns Promise<void>

  • Update User

    Parameters

    • row: Row
    • Optional plainPassword: string

    Returns Promise<void>

  • update 'last_mobile_login' columnwill

    Parameters

    • date: null | Date

      new login_date or null for logout (invalidates all jwts)

    Returns Promise<void>

  • Find users list

    Parameters

    • where: Where

      where object

    • Optional selectopts: SelectOptions

      select options

    Returns Promise<User[]>

  • Find or Create User

    Parameters

    • k: string
    • v: any
    • Optional uo: any = {}

    Returns Promise<false | User | ErrorMessage>

  • Get bcrypt hash for Password

    Parameters

    • pw: string

      password string

    Returns Promise<string>

  • Check that user table is not empty in database

    Returns Promise<boolean>

    true if there are users in db

    Deprecated

    use method count()

  • Reset password using token

    Parameters

    • __namedParameters: {
          email: string;
          password: string;
          reset_password_token: string;
      }
      • email: string
      • password: string
      • reset_password_token: string

    Returns Promise<ErrorMessage | SuccessMessage>

  • Validate password

    Parameters

    • pw: string

    Returns undefined | string

  • Verification with token

    Parameters

    • __namedParameters: {
          email: string;
          verification_token: string;
      }
      • email: string
      • verification_token: string

    Returns Promise<true | ErrorMessage>

    true if verification passed, error string if not

Generated using TypeDoc