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
}
func NewAuthService ¶
func NewAuthService( userStorage UserStorage, tokenStorage TokenStorage, jwtKey string, ) *AuthService
func (*AuthService) Login ¶
func (s *AuthService) Login( ctx context.Context, email string, password string, identifyData entities.UserIdentifyData, ) (entities.Tokens, error)
Move this to some service that implement registry pattern (consul).
func (*AuthService) RefreshToken ¶
func (s *AuthService) RefreshToken( ctx context.Context, refreshToken string, identifyData entities.UserIdentifyData, ) (entities.Tokens, error)
type TokenStorage ¶
type TokenStorage interface { CreateRefreshToken(ctx context.Context, token entities.RefreshToken) error GetAllActiveRefreshTokens(ctx context.Context, userID int) ([]entities.RefreshToken, error) DeactivateTokenByIDs(ctx context.Context, tokenIDs []int) error GetToken(ctx context.Context, refreshToken string) (entities.RefreshToken, error) }
Click to show internal directories.
Click to hide internal directories.