Skip to main content

Class: BaseUserInput

api-login/auth/dto/user-inputs.dto.BaseUserInput

Base input type containing all needed fields to create a new user

Hierarchy

Constructors

constructor

new BaseUserInput()

Properties

displayName

displayName: string

The name to display in the UI for the new user. Must be given and can't be empty

Example

"Test User"

Defined in

gropius-login-service/backend/src/api-login/auth/dto/user-inputs.dto.ts:22


email

Optional email: string

The email of the new user. Can be ommitted, but if given can't be empty.

Example

"test-user@example.com"

Defined in

gropius-login-service/backend/src/api-login/auth/dto/user-inputs.dto.ts:30


username

username: string

The username to set for the new user. Must be given and cannot be empty

Example

"testUser"

Defined in

gropius-login-service/backend/src/api-login/auth/dto/user-inputs.dto.ts:14

Methods

check

Static check(input): BaseUserInput

Checks for a valid BaseUserInput

Needed:

  • username is a required, non empty string
  • displayName is a required, non empty string
  • email is, if given, a non empty string

Parameters

NameTypeDescription
inputBaseUserInputThe instance to check

Returns

BaseUserInput

The argument unchanged

Throws

HttpException BAD_REQUEST if invalid

Defined in

gropius-login-service/backend/src/api-login/auth/dto/user-inputs.dto.ts:44