Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthService ¶
type AuthService struct {
// contains filtered or unexported fields
}
AuthService handles authentication operations.
func NewAuthService ¶
func NewAuthService(db *gorm.DB, cfg config.AuthConfig) *AuthService
NewAuthService creates an AuthService, seeds default credentials if needed, and syncs from the credentials file if present.
func (*AuthService) AuthMiddleware ¶
func (s *AuthService) AuthMiddleware() gin.HandlerFunc
AuthMiddleware returns a Gin middleware that validates JWT tokens. It accepts tokens from the Authorization: Bearer header OR from the ?token= query parameter (required for WebSocket connections which cannot set custom headers from browsers).
Click to show internal directories.
Click to hide internal directories.