Class: UsersController
api-login/auth/users.controller.UsersController
Controller allowing access to the users in the system
Constructors
constructor
• new UsersController(userService, backendUserService, loginDataSerive, strategiesService)
Parameters
| Name | Type |
|---|---|
userService | LoginUserService |
backendUserService | BackendUserService |
loginDataSerive | UserLoginDataService |
strategiesService | StrategiesService |
Defined in
gropius-login-service/backend/src/api-login/auth/users.controller.ts:47
Properties
backendUserService
• Private Readonly backendUserService: BackendUserService
Defined in
gropius-login-service/backend/src/api-login/auth/users.controller.ts:49
loginDataSerive
• Private Readonly loginDataSerive: UserLoginDataService
Defined in
gropius-login-service/backend/src/api-login/auth/users.controller.ts:50
strategiesService
• Private Readonly strategiesService: StrategiesService
Defined in
gropius-login-service/backend/src/api-login/auth/users.controller.ts:51
userService
• Private Readonly userService: LoginUserService
Defined in
gropius-login-service/backend/src/api-login/auth/users.controller.ts:48
Methods
createNewUser
▸ createNewUser(input): Promise<LoginUser>
Create a new user object (which has no authentications yet) based on the given data.
Needs admin permissions.
Meant for admins to create users which can then be linked a authentication by a admin. Can be used, if self registration os turned off for all strategies globally.
Parameters
| Name | Type | Description |
|---|---|---|
input | CreateUserAsAdminInput | Input data to create a new user from |
Returns
Promise<LoginUser>
If uscessful, the created user object
Defined in
gropius-login-service/backend/src/api-login/auth/users.controller.ts:138
getLoginDataForUser
▸ getLoginDataForUser(id, res): Promise<UserLoginDataResponse[]>
Gets the list of all login data of a single user specified by id.
Needs admin permission for any user other than the one sending the request (equivalen to self query).
Parameters
| Name | Type | Description |
|---|---|---|
id | string | The uuid string of the existing user to get the loginData for or 'self' |
res | Response<any, Record<string, any>> | The response object containing the request state |
Returns
Promise<UserLoginDataResponse[]>
If user exits, login data for the user with the specified id
Defined in
gropius-login-service/backend/src/api-login/auth/users.controller.ts:170
getOneUser
▸ getOneUser(id, res): Promise<LoginUser>
Get the user object of any user by its id.
Needs admin permission for any user other than the one sending the request (equivalen to self query).
Parameters
| Name | Type | Description |
|---|---|---|
id | string | The uuid string of the user to get the details for |
res | Response<any, Record<string, any>> | - |
Returns
Promise<LoginUser>
If existing and permitted, the user details of the requested user
Defined in
gropius-login-service/backend/src/api-login/auth/users.controller.ts:105
getOwnUser
▸ getOwnUser(res): Promise<LoginUser>
Gets the user object of the logged in user that is sending the request.
Parameters
| Name | Type | Description |
|---|---|---|
res | Response<any, Record<string, any>> | The response object containing the request state |
Returns
Promise<LoginUser>
The user details of the logged in user
Defined in
gropius-login-service/backend/src/api-login/auth/users.controller.ts:78
listAllUsers
▸ listAllUsers(): Promise<LoginUser[]>
Gets a list of all users in the system.
Needs admin permissions.
Returns
Promise<LoginUser[]>
List of all users in the system
Defined in
gropius-login-service/backend/src/api-login/auth/users.controller.ts:65