RezinaLMS-BackEnd/internal/services/authentication/service.go

33 lines
710 B
Go

package authentication
import (
"Rezina-Backend/internal/ports"
"Rezina-Backend/internal/services/user"
)
type ValidString struct {
Value string
Valid bool
}
type Tokens struct {
AccessToken string
RefreshToken string
}
type Service struct {
otpStore ports.OtpStore
userStore ports.UserStore
UserSvc *user.Service
tokenStore ports.TokenStore
RefreshExpiry int
}
func NewService(otpStore ports.OtpStore, userStore ports.UserStore, userSvc *user.Service, tokenStore ports.TokenStore, RefreshExpiry int) *Service {
return &Service{
otpStore: otpStore,
userStore: userStore,
UserSvc: userSvc,
tokenStore: tokenStore,
RefreshExpiry: RefreshExpiry,
}
}