create_user

Function create_user 

Source
pub async fn create_user(
    request: HttpRequest,
    pool: Data<PgPool>,
    payload: Json<CreateUserRequest>,
    tmc_client: Data<TmcClient>,
) -> ControllerResult<Json<CreateUserResponse>>
Expand description

POST /api/v0/tmc-server/users/create

Endpoint used by the TMC server to create a new user in this system.

Fetches the user details from tmc.mooc.fi and creates the user if they don’t already exist. Sets the provided password for the user.

Returns the created user and a boolean indicating whether the password was successfully set.

Only works if the authorization header is set to a valid shared secret between systems.