مدیریت کاربران از پیش ساخته شده شما
After you have successfully ran your webserver, it's be best to create a user in the system using email or phone number.
Fireback uses a term called "Passports" internally, each passport is a way to authenticate a user into the system. These users are public users, not administrators. Fireback tends to support different passports:
Having said that, in order to signup a user using email address, you need to use "Email passport", which is available under:
http://localhost:4500/passport/signup/email
http://localhost:4500/passport/signin/email
You need to check the "API Reference" section for changes, this document is only a walkthrough and might not provide exact signature for POST request.
Creating a user using email, is the most basic request, and does not need any specific headers. email
, password
are enough as body of request. The response, would contain UserSession
type, including a token, workspaces, roles
and user himself information.
The body for creating a new passport needs to be plain json, such as:
{
"email": "sampleuser2@gmail.com",
"password": "123321"
}
And the response for any kind of login, either email, sms, or oauth would be the UserSession
, which provides
a lot of information about user.
{
"data": {
"passport": {
"createdAt": "2023-01-02T05:07:12.899572+01:00",
"updatedAt": "2023-01-02T05:07:12.899572+01:00",
"deletedAt": null,
"type": "EmailPassword",
"value": "sampleuserx@gmail.com",
"confirmed": false,
"accessToken": "",
"userId": "f3ea5aed-bd9d-42c3-9dbc-ba34ad75a72d",
"uniqueId": "72f0b2e1-75d3-4432-b91e-a1bea3b2a273"
},
"user": {
"createdAt": "2023-01-02T05:07:12.898116+01:00",
"updatedAt": "2023-01-02T05:07:12.898116+01:00",
"deletedAt": null,
"firstName": "",
"lastName": "",
"photo": "",
"uniqueId": "f3ea5aed-bd9d-42c3-9dbc-ba34ad75a72d"
},
"token": "26a229a46e33aa907caff8f41d547328f7a9fc60297e069decf99d54d60d5a8a",
"userRoleWorkspaces": [
{
"createdAt": "2023-01-02T05:07:12.903578+01:00",
"updatedAt": "2023-01-02T05:07:12.903578+01:00",
"deletedAt": null,
"workspace": {
"createdAt": "2023-01-02T05:07:12.900878+01:00",
"updatedAt": "2023-01-02T05:07:12.900878+01:00",
"deletedAt": null,
"name": "sampleuserx@gmail.com workspace",
"description": "",
"uniqueId": "501d4bbf-0bed-4e13-beb3-d9a1d548a931"
},
"workspaceId": "501d4bbf-0bed-4e13-beb3-d9a1d548a931",
"role": {
"createdAt": "2023-01-02T05:07:12.902149+01:00",
"updatedAt": "2023-01-02T05:07:12.902149+01:00",
"deletedAt": null,
"uniqueId": "e6fd08c5-470d-46d2-bcb1-a2fa61a920de",
"name": "Administrator",
"parentRoleId": null,
"parentRole": null,
"capabilities": null,
"workspaceId": "501d4bbf-0bed-4e13-beb3-d9a1d548a931"
},
"roleID": "e6fd08c5-470d-46d2-bcb1-a2fa61a920de",
"user": {
"createdAt": "2023-01-02T05:07:12.898116+01:00",
"updatedAt": "2023-01-02T05:07:12.898116+01:00",
"deletedAt": null,
"firstName": "",
"lastName": "",
"photo": "",
"uniqueId": "f3ea5aed-bd9d-42c3-9dbc-ba34ad75a72d"
},
"userId": "f3ea5aed-bd9d-42c3-9dbc-ba34ad75a72d",
"uniqueId": "501d4bbf-0bed-4e13-beb3-d9a1d548a931"
}
],
"exchangeKey": "e807cfc7-0bb8-4a6b-8f4a-0bc3b1ab4db5"
}
}