auth

package
v0.0.0-...-72c0d7f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Credentials

type Credentials struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(queries *db.Queries, jwt_secret string, api_domain string, bcrypt_cost int) *Service

func (*Service) Authenticator

func (s *Service) Authenticator(next http.Handler) http.Handler

same as jwtauth.Authenticator but in json

func (*Service) CreateAccessToken

func (s *Service) CreateAccessToken(userDB db.User) (*http.Cookie, error)

func (*Service) CreateRefreshToken

func (s *Service) CreateRefreshToken() (*http.Cookie, error)

func (*Service) PublicRoutes

func (s *Service) PublicRoutes(r chi.Router)

func (*Service) Verifier

func (s *Service) Verifier() func(http.Handler) http.Handler

use the tokenAuth defined in the service for the Verifier middleware

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL