Authentication
chnage to use the BB auth
note
this endpoints meant for finance dashboard (not Implemented yet) so once the dashboard is ready no need to use this endpoints
the auth endpoints are used to authenticate the user and get the token and by users i mean company users and admin users
endpoint
POST /api/v1/login
POST /api/v1/singup
login
request
{
"email": "example@example.com",
"password": "123456"
}
response
{
"message": "Login Successful",
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYxYTc2YWQ1MmY5NDNmOTFhMDJkNGE2YiIsImZpcnN0TmFtZSI6ImhheWRlciIsImxhc3ROYW1lIjoiQWIiLC",
"data": {
"user": {
"id": "61a76ad52f943f91a02d4a6b",
"firstName": "hayder",
"lastName": "Ab",
"userName": "",
"email": "me@hayder.dev",
"role": "manager",
"status": "active",
"createdAt": "2021-12-01T12:30:13.551Z",
"updatedAt": "2021-12-01T12:30:13.551Z",
"phoneNumber": null,
"avatar": null,
"address": null,
"defaultCompany": null
}
}
}
Now you have access token you can use it to make request to other endpoints
signup
request
{
"firstName": "hayder",
"lastName": "Ab",
"email": "example@example.com",
"password": "123456"
}
parameters
Parameter | Type | in | Required | Description |
---|---|---|---|---|
firstName | string | body | Yes | user first name |
lastName | string | body | Yes | user last name |
string | body | Yes | user email | |
password | string | body | Yes | user password |
role | string | body | Yes | user role can be developer or manager or admin |
phoneNumber | int | body | No | user phone number |
address | json | body | No | user address |
avatar | string | body | No | user avatar |
createdAt | Date | body | No | user created at |
updatedAt | Date | body | No | user updated at |