Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthHandler ¶
type AuthHandler struct { AuthService *domain.AuthService CookieService *domain.CookieService AuthMiddleware *authmiddleware.AuthMiddleware }
AuthHandler is the handler that manages authentication for the API.
func Provide ¶
func Provide(authService domain.AuthService, cookieService domain.CookieService, authMiddleware *authmiddleware.AuthMiddleware) *AuthHandler
Provide provides a new AuthHandler containing the given AuthService.
func (*AuthHandler) Login ¶
func (a *AuthHandler) Login(c *gin.Context)
Login attempts to authenticate the given credentials retrieved from the body as JSON.
func (*AuthHandler) Logout ¶
func (a *AuthHandler) Logout(c *gin.Context)
Logout attempts to unauthenticate the given credentials retrieved from the body as JSON.
func (*AuthHandler) Refresh ¶
func (a *AuthHandler) Refresh(c *gin.Context)
Refresh attempts to preform a refresh for a user's auth token.
func (*AuthHandler) Register ¶
func (a *AuthHandler) Register(parentGroup *gin.RouterGroup) error
Register creates three endpoints to handle login, logout, and refresh functionality. / (POST) - Login / (DELETE) - Logout /refresh (POST) - Refresh
Click to show internal directories.
Click to hide internal directories.