RyZ
fix: fixing auth logic
f7fe55b
package dto
import "github.com/google/uuid"
type RegisterRequest struct {
Username string `json:"username" binding:"required,min=3"`
Password string `json:"password" binding:"required,min=6"`
}
type LoginRequest struct {
Username string `json:"username" binding:"required"`
Password string `json:"password" binding:"required"`
}
type AuthResponse struct {
AccessToken string `json:"access_token,omitempty"`
SuccessMsg string `json:"success_msg,omitempty"`
RefreshToken string `json:"-"`
UserID uuid.UUID `json:"user_id,omitempty"`
Username string `json:"username,omitempty"`
}
type RegisterEnabledResponse struct {
Register bool `json:"register"`
}
type LogoutResponse struct {
SuccessMsg string `json:"success_msg"`
}
type SetRegistrationRequest struct {
Enabled bool `json:"enabled"`
}
type MeResponse struct {
UserID uuid.UUID `json:"user_id,omitempty"`
Username string `json:"username"`
Role string `json:"role"`
Phone string `json:"phone,omitempty"`
JID string `json:"jid,omitempty"`
AccountName string `json:"account_name,omitempty"`
IsActive bool `json:"is_active"`
}