Skip to main content

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

ParameterTypeinRequiredDescription
firstNamestringbodyYesuser first name
lastNamestringbodyYesuser last name
emailstringbodyYesuser email
passwordstringbodyYesuser password
rolestringbodyYesuser role can be developer or manager or admin
phoneNumberintbodyNouser phone number
addressjsonbodyNouser address
avatarstringbodyNouser avatar
createdAtDatebodyNouser created at
updatedAtDatebodyNouser updated at