Skip to content

User authentication

AuxiliumCDNG edited this page Jan 5, 2022 · 3 revisions

Authentication endpoints

This part of the api uses flask-login to authenticate users. This is done by setting a login cookie. These endpoints were designed to be used with the form tag/action in HTML. However, they may just as well be used with javascript to prevent the site from reloading. The session cookies will be saved by the browser nevertheless. You will have to submit the data with a form, however. You may use this method to do that.

Registration

POST /register/

form-data:

  • username
  • email
  • password

returns either:

  • 409 (if email has already been taken)
  • 400 (if plain request was sent)
  • 200

Login/Logout

POST /login/

form-data:

  • email (the users email address)
  • password (the users password

returns either:

  • 100 (if you are already logged in)
  • 403 (there was a problem; is the user active?)
  • 401 (wrong password)
  • 404 (user not found)
  • 200

GET /logout/

returns:

  • 200
Clone this wiki locally