feat(auth): implement web login endpoint with JWT

This commit is contained in:
Mrixs committed 2025-06-16 08:25:20 +03:00
1 parent 9c7940a70a
commit 45173c406c
5 files changed
+112

No files matched your search

+13
View File
@@ -74,3 +74,16 @@ type JoinRequest struct {
SelectedProfile string `json:"selectedProfile"` // UUID пользователя без дефисов
ServerID string `json:"serverId"`
}
// LoginRequest - это тело запроса на /api/login
type LoginRequest struct {
// Позволяем логиниться как по username, так и по email
Login string `json:"login"`
Password string `json:"password"`
}
// LoginResponse - это тело успешного ответа с JWT
type LoginResponse struct {
Token string `json:"token"`
User *User `json:"user"` // Отдаем информацию о пользователе
}