auth.go 385 B

1234567891011121314
  1. package interfaces
  2. import (
  3. "git.dmitriygnatenko.ru/dima/dmitriygnatenko-v2/internal/models"
  4. "github.com/gofiber/fiber/v2"
  5. "github.com/golang-jwt/jwt/v4"
  6. )
  7. type Auth interface {
  8. GeneratePasswordHash(password string) (string, error)
  9. IsCorrectPassword(password string, hash string) bool
  10. GenerateToken(user models.User) (string, error)
  11. GetClaims(fctx *fiber.Ctx) jwt.MapClaims
  12. }