User

User

User

Package: @vendure/core File: user.entity.ts

A User represents any authenticated user of the Vendure API. This includes both Administrators as well as registered Customers.

Signature

class User extends VendureEntity implements HasCustomFields {
  constructor(input?: DeepPartial<User>)
  @Column({ unique: true })
    identifier: string;
  @Column({ select: false }) passwordHash: string;
  @Column({ default: false })
    verified: boolean;
  @Column({ type: 'varchar', nullable: true })
    verificationToken: string | null;
  @Column({ type: 'varchar', nullable: true })
    passwordResetToken: string | null;
  @Column({ type: 'varchar', nullable: true })
    identifierChangeToken: string | null;
  @Column({ type: 'varchar', nullable: true })
    pendingIdentifier: string | null;
  @ManyToMany(type => Role)
    @JoinTable()
    roles: Role[];
  @Column({ nullable: true })
    lastLogin: string;
  @Column(type => CustomUserFields)
    customFields: CustomUserFields;
}

Members

constructor

method
type:
(input?: DeepPartial<User>) => User

identifier

property
type:
string

passwordHash

property
type:
string

verified

property
type:
boolean

verificationToken

property
type:
string | null

passwordResetToken

property
type:
string | null

identifierChangeToken

property
type:
string | null
A token issued when a User requests to change their identifier (typically an email address)

pendingIdentifier

property
type:
string | null
When a request has been made to change the User’s identifier, the new identifier will be stored here until it has been verfified, after which it will replace the current value of the identifier field.

roles

property
type:
Role[]

lastLogin

property
type:
string

customFields

property
type:
CustomUserFields