Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPasswordHash ¶
Checks if the password is same as the hashed password
Types ¶
type Claims ¶
type Claims struct { Username string `json:"username"` jwt.StandardClaims }
Represents the claims of the JWT token
type LoginHandler ¶
type LoginHandler struct {
// contains filtered or unexported fields
}
func NewLoginHandler ¶
func NewLoginHandler(service *LoginService) *LoginHandler
func (*LoginHandler) LoginHandler ¶
func (h *LoginHandler) LoginHandler(c *gin.Context)
LoginHandler, Login kullanıcılarının giriş yapmasına olanak tanır. @Summary Login login @Description Authenticates an Login user and returns a JWT token. @Tags Auth @Accept json @Produce json @Param Login body auth.LoginRequest true "Login login credentials" @Success 200 {object} models.TokenResponse "JWT token" @Failure 400 {object} models.ErrorResponse "Invalid request" @Failure 401 {object} models.ErrorResponse "Invalid username or password" @Router /Login/login [post]
type LoginRequest ¶
type LoginService ¶
type LoginService struct {
// contains filtered or unexported fields
}
func NewLoginService ¶
func NewLoginService(userRepo UserRepository, jwtSecret []byte) *LoginService
func (*LoginService) AuthenticateAdmin ¶
func (s *LoginService) AuthenticateAdmin(username, password string) (string, error)
type UserRepository ¶
func NewUserRepository ¶
func NewUserRepository(db *gorm.DB) UserRepository
Click to show internal directories.
Click to hide internal directories.