Skip to main content

auth

User authentication

AuthProvider.auth(marker, data)

const data = {
authData: [
{
marker: "login",
value: "example@oneentry.cloud"
},
{
marker: "password",
value: "12345"
}
]
}

const value = await AuthProvider.auth('email', data)
Schema

marker: string The text identifier of the authorization provider example: email

data: IAuthPostBody Array of objects contains auth information example:

{
"authData": [
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
]
}

Schema

authData: string Authorization data taken from the form attached to the authorization provider example:

[ 
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
]

This method performs user authorization. Returns an object with a set of tokens.

Example return:

{
"userIdentifier": "example@oneentry.cloud",
"authProviderIdentifier": "email",
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MywiYXV0aFByb3ZpZGVySWRlbnRpZmllciI6ImVtYWlsIiwidXNlcklkZW50aWZpZXIiOiJ0ZXN0QHRlc3QucnUiLCJ1c2VyQWdlbnQiOiJQb3N0bWFuUnVudGltZS83LjM3LjMiLCJpYXQiOjE3MTQ1NTc2NzAsImV4cCI6MTcxNDU2MTI3MH0.vm74Ha-S37462CAF3QiDpO9b0OhlJFNDMKq4eEyoaB8",
"refreshToken": "1714557670334-cb85112d-618d-4b2a-bad5-137b19c135b9"
}
Schema

userIdentifier: string user identifier example: example@oneentry.cloud

authProviderIdentifier: string auth provider identifier example: email

accessToken: string access token example: 'eyJhbGciOiJIUzI1NiIsI...b0OhlJFNDMKq4eEyoaB8'

refreshToken: string refresh token example: '1714557670334-...-137b19c135b9'