Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidCredentials = errors.New("invalid credentials")
)
Functions ¶
This section is empty.
Types ¶
type AppProvider ¶
type Auth ¶
type Auth struct {
// contains filtered or unexported fields
}
func New ¶
func New( log *slog.Logger, userSaver UserSaver, userProvider UserProvider, appProvider AppProvider, tokenTTL time.Duration, ) *Auth
func (*Auth) Login ¶
func (a *Auth) Login( ctx context.Context, email string, password string, appID int, ) (string, error)
Login checks if user with given credentials exists in the system and returns access token.
If user exists, but password is incorrect, returns error. If user doesn't exist, returns error.
type UserProvider ¶
Click to show internal directories.
Click to hide internal directories.