All routes require a JWT token to access (except /auth/
routes)
To access routes, first obtain your token, then, pass it in the Authorization
header using the format Bearer <your token>
.
Some objects are reused in a number of routes. Their properties are listed here.
Represents a subject of the user.
Property | Type | Constraints | Description |
---|---|---|---|
name | string | max length: 100 required. |
The subject's display name. |
slug | slug | max length: 100 must be unique to the user. |
Derived from the name , contains only alphanumerical characters and the dash "-". Case insensitive. |
|
Obtain a JWT token, given a email and a password.
Provide the email
and password
in the request's body as such:
{
"email": "<your email>",
"password": "<your password>"
}
The response will be of the following form:
{
"access": "<your access token>",
"refresh": "<your refresh token>"
}
Renew your access token provided the refresh token
Given the refresh token:
{
"refresh": "<your refresh token>"
}
The response will contain the new access token:
{
"access": "<your new access token>",
}
Information about the current user (the one authentificated by the access token)
The response will contain:
email
- unique (case insensitive)activated
- Whether or not the user has confirmed his email address.
Create an account.
The request must contain:
- password
Upon registration, the API...
- creates a new unique activation token and saves it on
<the user>.activation_token
- sends a confirmation email to
email
, this email contains a button that links tohttps://api.schoolsyst.com/users/activate/?token=<the verify token>&email=<the email address>
Query parameters:
Name | Type | Constraints | Description |
---|---|---|---|
email address | Exists in the database | ||
token | string | Exists in the database | Stored as a property named activation_token on each user. Destroyed 24 hours after creation. |
Routes beyond this point require the user to have its activation state (activated
property) set to true
. Otherwise a 401 Unauthorized
response will be sent.
Settings of the user.
Name | Type | Constraints | Default value | Description |
---|---|---|---|---|
theme | One of 'light', 'dark' or 'auto' | 'auto' |
|
A progressive Node.js framework for building efficient and scalable server-side applications, heavily inspired by Angular.
Nest framework TypeScript starter repository.
$ npm install
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.
- Author - Kamil Myśliwiec
- Website - https://nestjs.com
- Twitter - @nestframework
Nest is MIT licensed.