Module auth

Source
Expand description

Handlers for HTTP requests to /api/v0/auth.

Structs§

CreateAccountDetails
Login
UserInfo
Generic information about the logged in user.

Functions§

_add_routes
authorize_action_on_resource
POST /api/v0/auth/authorize checks whether user can perform specified action on specified resource.
authorize_multiple_actions_on_resources
POST /api/v0/auth/authorize-multiple checks whether user can perform specified action on specified resource. Returns booleans for the authorizations in the same order as the input.
logged_in
GET /api/v0/auth/logged-in Returns the current user’s login status.
login
POST /api/v0/auth/login Logs in to TMC. Returns true if login was successful, false if credentials were incorrect.
logout
POST /api/v0/auth/logout Logs out.
post_new_user_to_moocfi
Posts new user account to tmc.mooc.fi.
signup
POST /api/v0/auth/signup Creates new mooc.fi account and signs in.
user_info
GET /api/v0/auth/user-info Returns the current user’s info.