Documentation ¶
Index ¶
- Constants
- func LoadRoutes(r chi.Router, config config.Config, store *store.PostgresStore)
- type AuthHandler
- type AuthService
- func (s *AuthService) Login(ctx context.Context, email string, password string) (string, time.Time, string, time.Time, error)
- func (s *AuthService) Logout(ctx context.Context, userId string) error
- func (s *AuthService) Refresh(ctx context.Context, refreshToken string) (string, time.Time, string, time.Time, error)
- type LoginReq
- type PostgresRepository
- func (repo *PostgresRepository) Login(ctx context.Context, email string, password string) (*accounts.Account, error)
- func (repo *PostgresRepository) UpdateRefreshTokenJtiByUserId(ctx context.Context, jti string, accountId string) error
- func (repo *PostgresRepository) UpdateRefreshTokenJtiByUserIdAndJti(ctx context.Context, accountId string, jti string, newJti string) error
Constants ¶
View Source
const ( LinktlyAccessTokenCookieName = "access_token" LinktlyRefreshTokenCookieName = "refresh_token" )
Variables ¶
This section is empty.
Functions ¶
func LoadRoutes ¶
func LoadRoutes(r chi.Router, config config.Config, store *store.PostgresStore)
Types ¶
type AuthHandler ¶
type AuthHandler struct {
// contains filtered or unexported fields
}
func (AuthHandler) Login ¶
func (a AuthHandler) Login(w http.ResponseWriter, r *http.Request) error
func (AuthHandler) Logout ¶
func (a AuthHandler) Logout(w http.ResponseWriter, r *http.Request) error
func (AuthHandler) Refresh ¶
func (a AuthHandler) Refresh(w http.ResponseWriter, r *http.Request) error
func (AuthHandler) Signup ¶
func (a AuthHandler) Signup(w http.ResponseWriter, r *http.Request) error
type AuthService ¶
type AuthService struct {
// contains filtered or unexported fields
}
type LoginReq ¶
type PostgresRepository ¶
type PostgresRepository struct {
// contains filtered or unexported fields
}
func GetNewAuthRepository ¶
func GetNewAuthRepository(store *store.PostgresStore) *PostgresRepository
func (*PostgresRepository) UpdateRefreshTokenJtiByUserId ¶
func (*PostgresRepository) UpdateRefreshTokenJtiByUserIdAndJti ¶
Click to show internal directories.
Click to hide internal directories.