From a1db1c557a3371766d3b9159b388f5dffd829b54 Mon Sep 17 00:00:00 2001
From: Pavel Antonov <antonov@perx.ru>
Date: Fri, 1 Nov 2024 09:58:33 +0000
Subject: [PATCH] =?UTF-8?q?chore:=20=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?=
 =?UTF-8?q?=D0=B5=D0=BD=20=D0=BC=D0=B5=D1=82=D0=BE=D0=B4=20Users.Login?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 proto/users/users.proto | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/proto/users/users.proto b/proto/users/users.proto
index 94b7543..c45f4fe 100644
--- a/proto/users/users.proto
+++ b/proto/users/users.proto
@@ -29,6 +29,15 @@ message Filter {
   google.protobuf.BoolValue system = 10;
 }
 
+message LoginRequest {
+  string email = 1;
+  string identity = 2;
+}
+
+message LoginResponse {
+  User user = 1;
+}
+
 message CreateRequest {
   User create = 1;
 }
@@ -73,7 +82,14 @@ message GetByIdentityResponse {
   User user = 1;
 }
 
+
 service Users  {
+  // Метод для авторизации пользователя. Возвращает информацию о пользователе
+  // Пользователь может быть авторизован в разных системах IdP, поэтому
+  // авторизация происходит по email и identity. Если для одного email есть
+  // несколько identity, то они будут объединены в одного пользователя
+  rpc Login(LoginRequest) returns(LoginResponse) {}
+
   // Создание пользователя или регистрация текущего пользователя в системе, если create.id == `current`
   rpc Create(CreateRequest) returns(CreateResponse) {}
 
-- 
GitLab