Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrForbidden when HTTP status 403 is given ErrForbidden = errors.New("you don't have permission to access this resource") // ErrMissingLoginValues indicates a user tried to authenticate without username or password ErrMissingLoginValues = errors.New("missing Username or Password") // ErrFailedAuthentication indicates authentication failed, could be faulty username or password ErrFailedAuthentication = errors.New("incorrect Username or Password") )
Functions ¶
func AuthMiddleware ¶
func AuthMiddleware(svc accounts.Service) *jwt.GinJWTMiddleware
AuthMiddleware returns auth middleware
func InitRouter ¶
func InitRouter(r *gin.RouterGroup, svc accounts.Service) *gin.RouterGroup
InitRouter register accounts API routes
Types ¶
type RegisterReq ¶
RegisterReq defins User registration payload
type UserContext ¶
UserContext defines user object which we propagates throu the context After successful authentication object is avaiblable in *gin.Context as User
type UserHandler ¶
UserHandler specify methods for handling user requests
Click to show internal directories.
Click to hide internal directories.