Skip to content

Auth

Login

Method: POST

Endpoint: /auth/login

Auth Login

This endpoint is used to authenticate a user and obtain an access token.

Request Body

  • email (string): The email of the user.

  • password (string): The password of the user.

Response

The response is a JSON object with the following schema:

{
  "account": {
    "id": "",
    "name": "",
    "email": "",
    "type": "",
    "provider": "",
    "roles": [
      {
        "id": "",
        "name": "",
        "permissions": [""],
        "description": ""
      }
    ],
    "description": "",
    "verified": true,
    "enabled": true
  },
  "token": ""
}

 ```

### Request Body

```json
{
  "email": "pierre@codativity.com",
  "password": "Password0!"
}

Register

Method: POST

Endpoint: /auth/register

Request Body

{
  "name": "Pierre Du Toit",
  "email": "subaquatic.pierre@gmail.com",
  "password": "Password01",
  "redirectHost": "http://localhost:8081/",
  "confirmEmailRedirectEndpoint": "/auth/sign-in",
  "dashboardEndpoint": "/dashboard",
  "projectName": "CodaWeb"
}

ConfirmAccount

Method: GET

Endpoint: /auth/confirm-account?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI2MGU1ZWE2Ni1iNWMzLTRjN2ItYjVlYy0wMTMyODk2MzQwOTQiLCJleHAiOjk5OTk5OTk5OTk5OTk5OTksImlhdCI6MTcyMTU4MTk5OCwiYWNjX3R5cGUiOiJ1c2VyIiwidG9rZW5fdHlwZSI6IkNvbmZpcm1BY2NvdW50In0.c8AxoBP0iAeqS9d5h9dyKMduBjfDVSU2NX1ydjeyqZQ&redirect_url=http://localhost:8081/auth/sign-in

RefreshToken

Method: GET

Endpoint: /auth/refresh-token

Authentication: bearer

Method: POST

Endpoint: /auth/resend-confirm

Request Body

{
  "email": "subaquatic.pierre@gmail.com",
  "redirectHost": "http://localhost:8081/",
  "confirmEmailRedirectEndpoint": "/auth/sign-in",
  "dashboardEndpoint": "/admin",
  "projectName": "CodaWeb"
}

ResetPassword

Method: POST

Endpoint: /auth/reset-password

Request Body

{
  "email": "subaquatic.pierre@gmail.com",
  "redirectUrl": "{{host}}/auth/update-password",
  "projectName": "CodaWeb"
}

UpdatePassword

Method: POST

Endpoint: /auth/update-password

Request Body

{
  "token": "",
  "password": "AMAZING"
}