auth
User authentication.
AuthProvider?.auth( marker?, body? );
Minimal example
const body = {
"authData": [?{
"marker": "login",?"value": "example@oneentry.cloud"?},{
"marker": "password",?"value":"12345"?}],};
const value = await AuthProvider.auth('email', body)
Schema
marker(required): string
The text identifier of the authorization provider
example: "email"
body(required): IAuthPostBody
Array of objects contains auth information
example:
{
"authData": [
{
"marker": "login",
"value": "example@oneentry.cloud"
},
{
"marker": "password",
"value": "12345"
}
]
}
body.authData any[]
Authorization data taken from the form attached to the authorization provider
example: ""
[
{
"marker": "login",
"value": "example@oneentry.cloud"
},
{
"marker": "password",
"value": "12345"
}
]
body.authData[index].marker string
Registration form login attribute marker
example: "example@oneentry.cloud"
body.authData[index].value string
Registration form login attribute value
example: "12345"
This method performs user authorization. Returns an object with a set of tokens.
Example response
{
"userIdentifier": "test@test.ru",
"authProviderIdentifier": "email",
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6OCwiYXV0aFByb3ZpZGVySWRlbnRpZmllciI6ImVtYWlsIiwidXNlcklkZW50aWZpZXIiOiJ0ZXN0QHRlc3QucnUiLCJ1c2VyQWdlbnQiOiJub2RlIiwiaWF0IjoxNzUzMDkwODAzLCJleHAiOjE3NTMxMjY4MDN9.A7GkUmqKcKDKCcSVV9FITqOD0LebvgurvIUMqzy7E4w",
"refreshToken": "1753090803738-11c4d812-662e-42c6-a08e-4d882e493bfb"
}
Schema
userIdentifier: string
The unique identifier for the user.
example: "user12345"
authProviderIdentifier: string
The identifier for the authentication provider.
example: "email"
accessToken: string
The access token for the user session.
example: "abcdef123456"
refreshToken: string
The refresh token for renewing the access token.
example: "ghijkl789012"