Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
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
New returns a new instance of the Auth service.
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, return error.
type UserProvider ¶
Click to show internal directories.
Click to hide internal directories.