Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type aliases

AdminGroupData

AdminGroupData: CurrentGroupData

AdminUserData

AdminUserData: CurrentUserData & { cancelEmailAddress?: string; cancelEmailSecret?: string; emailChangeDate?: number; group?: Group & AdminGroupData; groups?: (Group & AdminGroupData)[]; newEmailAddress?: string; newEmailSecret?: string; passwordTemp?: string; recoverSecret?: string; recoverSecretDate?: number; secret?: string }

ClientConfig

ClientConfig: { allowRegistration: boolean; allowUsernameChange: boolean; emailUsernames: boolean; pwRecovery: boolean; regFields: string[]; unverifiedAccess: boolean; userFields: string[]; verifyEmail: boolean }

Type declaration

  • allowRegistration: boolean
  • allowUsernameChange: boolean
  • emailUsernames: boolean
  • pwRecovery: boolean
  • regFields: string[]
  • unverifiedAccess: boolean
  • userFields: string[]
  • verifyEmail: boolean

CurrentGroupData

CurrentGroupData: GroupData & { abilities?: string[]; email?: string; phone?: string; user?: (User & CurrentUserData) | null }

CurrentUserData

CurrentUserData: UserData & { abilities?: string[]; email?: string; group?: Group & CurrentGroupData; groups?: (Group & CurrentGroupData)[]; inheritAbilities?: boolean; phone?: string }

EventType

EventType: "register" | "login" | "logout"

GroupData

GroupData: { avatar?: string; defaultPrimary?: boolean; defaultSecondary?: boolean; enabled?: boolean; groupname?: string; name?: string; parent?: Group & GroupData; unverifiedSecondary?: boolean }

Type declaration

  • Optional avatar?: string

    The group's avatar URL. (Use getAvatar() to support Gravatar.)

  • Optional defaultPrimary?: boolean

    Whether this group is the default primary group for new users.

  • Optional defaultSecondary?: boolean

    Whether this group is a default secondary group for new users.

  • Optional enabled?: boolean

    Whether the group can be used.

  • Optional groupname?: string

    The group's groupname.

  • Optional name?: string

    The group's name.

  • Optional parent?: Group & GroupData

    The group's parent.

  • Optional unverifiedSecondary?: boolean

    Whether this group is a default secondary group for unverified users.

LoginCallback

LoginCallback: (user: User & CurrentUserData) => void

Type declaration

LogoutCallback

LogoutCallback: (user: User & UserData) => void

Type declaration

RegisterCallback

RegisterCallback: (user: User & CurrentUserData) => void

Type declaration

RegistrationDetails

RegistrationDetails: { additionalData?: {}; email?: string; nameFirst?: string; nameLast?: string; password: string; password2: string; phone?: string; username: string; usernameVerified: boolean }

Type declaration

  • Optional additionalData?: {}

    Additional data to be included in the request.

    • [k: string]: any
  • Optional email?: string

    The new user's email address.

  • Optional nameFirst?: string

    The new user's given name.

  • Optional nameLast?: string

    The new user's surname.

  • password: string

    New user's password.

  • password2: string

    Repeat the password.

  • Optional phone?: string

    The new user's phone number.

  • username: string

    New user's username.

  • usernameVerified: boolean

    Whether the username passed verification.

UserData

UserData: { avatar?: string; enabled?: boolean; name?: string; nameFirst?: string; nameLast?: string; nameMiddle?: string; username?: string }

Type declaration

  • Optional avatar?: string

    The user's avatar URL. (Use $getAvatar() to support Gravatar.)

  • Optional enabled?: boolean

    Whether the user can log in.

  • Optional name?: string

    The user's full name.

  • Optional nameFirst?: string

    The user's first name.

  • Optional nameLast?: string

    The user's last name.

  • Optional nameMiddle?: string

    The user's middle name.

  • Optional username?: string

    The user's username.

Functions

checkUsername

  • checkUsername(User: typeof User, username: string, clientConfig?: ClientConfig): Promise<{ message: string }>

login

  • login(User: typeof User, username: string, password: string, additionalData?: {}): Promise<{ message: string; user?: User & UserData & { abilities?: string[]; email?: string; group?: Group & GroupData & { abilities?: string[]; email?: string; phone?: string; user?: null | (User & UserData & { abilities?: string[] | undefined; email?: string | undefined; phone?: string | undefined; group?: (Group & GroupData & { abilities?: string[] | undefined; email?: string | undefined; phone?: string | undefined; user?: (User & ... 1 more ... & ...) | ... 1 more ... | undefined; }) | undefined; groups?: (Group & ......) }; groups?: (Group & GroupData & { abilities?: string[]; email?: string; phone?: string; user?: null | (User & UserData & { abilities?: string[] | undefined; email?: string | undefined; phone?: string | undefined; group?: (Group & GroupData & { abilities?: string[] | undefined; email?: string | undefined; phone?: string | undefined; user?: (User & ... 1 more ... & ...) | ... 1 more ... | undefined; }) | undefined; groups?: (Group & ......) })[]; inheritAbilities?: boolean; phone?: string } }>
  • Parameters

    • User: typeof User
    • username: string
    • password: string
    • Optional additionalData: {}
      • [k: string]: any

    Returns Promise<{ message: string; user?: User & UserData & { abilities?: string[]; email?: string; group?: Group & GroupData & { abilities?: string[]; email?: string; phone?: string; user?: null | (User & UserData & { abilities?: string[] | undefined; email?: string | undefined; phone?: string | undefined; group?: (Group & GroupData & { abilities?: string[] | undefined; email?: string | undefined; phone?: string | undefined; user?: (User & ... 1 more ... & ...) | ... 1 more ... | undefined; }) | undefined; groups?: (Group & ......) }; groups?: (Group & GroupData & { abilities?: string[]; email?: string; phone?: string; user?: null | (User & UserData & { abilities?: string[] | undefined; email?: string | undefined; phone?: string | undefined; group?: (Group & GroupData & { abilities?: string[] | undefined; email?: string | undefined; phone?: string | undefined; user?: (User & ... 1 more ... & ...) | ... 1 more ... | undefined; }) | undefined; groups?: (Group & ......) })[]; inheritAbilities?: boolean; phone?: string } }>

register

Generated using TypeDoc