feat(auth): implement web login endpoint with JWT
This commit is contained in:
@@ -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"` // Отдаем информацию о пользователе
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user