Expand description
Handlers for HTTP requests to /api/v0/auth.
StructsΒ§
- Auth
Routes ApiDoc - Create
Account Details - Email
Code - Login
- Send
Email Code Data - User
Info - Generic information about the logged in user.
- Verify
Email Request
EnumsΒ§
- Delete
User Account Result - Outcome of spending an account deletion code.
- Login
Response - Send
Delete User Email Code Result - Outcome of asking for an account deletion code.
- Signup
Response - TmcDeletion
Failure π - How a failed TMC delete should be treated. The upstream status is what separates a retry that may work from one that never will.
FunctionsΒ§
- _add_
routes - authorize_
action_ on_ resource - POST
/api/v0/auth/authorizechecks whether user can perform specified action on specified resource. - authorize_
multiple_ actions_ on_ resources - POST
/api/v0/auth/authorize-multiplechecks whether user can perform specified action on specified resource. Returns booleans for the authorizations in the same order as the input. - classify_
tmc_ πdeletion_ failure - delete_
user_ account - POST
/api/v0/auth/delete-user-accountIf users single-use code is correct then delete users account - handle_
email_ πverification - handle_
production_ πlogin - handle_
test_ πmode_ login - handle_
test_ πmode_ signup - handle_
uuid_ πlogin - is_
duplicate_ πemail_ error_ message - logged_
in - GET
/api/v0/auth/logged-inReturns the current userβs login status. - login
- POST
/api/v0/auth/loginLogs in to the system. Returns LoginResponse indicating success, email verification required, or failure. - logout
- POST
/api/v0/auth/logoutLogs out. - report_
tmc_ πdeletion_ rejection - Records a TMC refusal under
referenceinerror_variants/error_occurrences, so support can find it from the reference alone. - send_
delete_ user_ email_ code - POST
/api/v0/auth/send-email-codeIf users password is correct, sends a code to users email for account deletion - signup
- POST
/api/v0/auth/signupCreates new mooc.fi account and signs in. - update_
user_ information_ to_ tmc - user_
info - GET
/api/v0/auth/user-infoReturns the current userβs info. - verify_
email - POST
/api/v0/auth/verify-emailVerifies email verification code and completes login.