31 lines
649 B
Go
31 lines
649 B
Go
package authentication
|
|
|
|
import "github.com/SamuelTariku/FortuneBet-Backend/internal/ports"
|
|
|
|
// type EmailPhone struct {
|
|
// Email ValidString
|
|
// PhoneNumber ValidString
|
|
// Password ValidString
|
|
// }
|
|
type ValidString struct {
|
|
Value string
|
|
Valid bool
|
|
}
|
|
type Tokens struct {
|
|
AccessToken string
|
|
RefreshToken string
|
|
}
|
|
type Service struct {
|
|
userStore ports.UserStore
|
|
tokenStore ports.TokenStore
|
|
RefreshExpiry int
|
|
}
|
|
|
|
func NewService(userStore ports.UserStore, tokenStore ports.TokenStore, RefreshExpiry int) *Service {
|
|
return &Service{
|
|
userStore: userStore,
|
|
tokenStore: tokenStore,
|
|
RefreshExpiry: RefreshExpiry,
|
|
}
|
|
}
|