API: Аутентификация - MCODEDOTSU/panorama.back GitHub Wiki
API: Аутентификация
Для всех запросов, не отмеченных как NOAUTH, необходимо добавить в заголовок Authorization:
"Bearer {TOKEN}"
TOKEN получается на этапе аутентификации в системе
Аутентификация пользователя в системе [NOAUTH]
METHOD: POST
NAME: api/login
QUERY PARAMETERS:
- email * [Адрес электронной почты]
- password * [Пароль]
RESPONSES:
{
access_token: string,
token_type: string,
expires_at: datetime,
role: string
}
Выход из системы
METHOD: GET
NAME: api/logout
RESPONSES:
{
'logout',
}
Получить данные профиля
METHOD: GET
NAME: api/user
RESPONSES:
{
id: integer,
name: string,
email: string,
email_verified_at: datetime | null,
contractor_id: integer,
created_at: datetime | null,
updated_at: datetime | null,
role: string,
post: string | null,
photo: string | null,
person_id: integer | null,
contractor: {
id: integer,
name: string,
full_name: string,
inn: string,
kpp: string | null,
address_id: integer | null,
created_at: datetime | null,
updated_at: datetime | null,
logo: string | null
},
contractor_address: string | null,
modules: [ {
id: integer,
title: string,
description: string,
created_at: datetime | null,
updated_at: datetime | null,
pivot: {
contractor_id: integer,
module_id: integer,
}
} ],
}