feat(auth): implement web login endpoint with JWT

This commit is contained in:
2025-06-16 08:25:20 +03:00
parent 9c7940a70a
commit 45173c406c
5 changed files with 112 additions and 0 deletions

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"` // Отдаем информацию о пользователе
}