You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note -- The professors and students have different endpoints to login, because the student array is a child of the professor array. Check your endpoints!
PROFESSOR REGISTRATION ENDPOINT
DESCRIPTION
TYPE
ENDPOINT
register professor (this is different from student registration)
POST
/api/auth/register
Items needed to Register
NAME
TYPE
REQUIRED
DESCRIPTION
lastname
string
yes
last name
firstname
string
yes
first name
username
string
yes
username (required for login, cannot be duplicate)
password
string
yes
password (required for login)
email
string
yes
email (cannot be duplicate)
role:admin
string
no
required to have admin privileges on site, but not required to create an account -- default is 'user' with no permissions
-- Note - This is our default admin and has an account already set up for easy access - please use him to login, and you won't need to register!
Professor's successful registration returns a token, their username, id, etc.
{
"token": "some garbled giant string of letters and numbers",
"message": "Welcome KiteGuy",
"id": 1,
"ETC"
}
If you already have a Professor set up, you can go straight to login:
PROFESSOR LOGIN ENDPOINT
DESCRIPTION
TYPE
ENDPOINT
login professor (this is different from student login)
POST
/api/login
Items needed to login:
NAME
TYPE
REQUIRED
DESCRIPTION
username
string
yes
username - must match registration
password
string
yes
password - must match registration
Professor's successful login returns a token, username, etc:
{
"token": "giant string of letters and numbers",
"message": "Welcome KiteGuy"
}
STUDENT REGISTRATION ENDPOINT
DESCRIPTION
TYPE
ENDPOINT
register student
POST
/api/auth/register/:id
-- Note -- it would be nice if the id you use here is the same as the professor id, but it's not necessary. Just use 1 if you don't want to think about it. Student reg and login also produce tokens.
Items needed to register
NAME
TYPE
REQUIRED
DESCRIPTION
lastname
string
yes
last name
firstname
string
yes
first name
username
string
yes
username (required for login, cannot be duplicate)
password
string
yes
password (required for login)
email
string
yes
email (cannot be duplicate)
professor_id
number
yes
required to add a student to a professor - if unsure, add to professor_id:1