18 lines
731 B
Go
18 lines
731 B
Go
package auth
|
|
|
|
import "github.com/gin-gonic/gin"
|
|
|
|
// RegisterCustomerRoutes mounts the customer-space auth endpoints. Always
|
|
// mounted (unlike earlier phases), but Register/Login reject every request
|
|
// with 403 while the admin has customer accounts turned off
|
|
// (CustomerHandler.accountsEnabledOrAbort), so the surface is a no-op until
|
|
// then.
|
|
func RegisterCustomerRoutes(rg *gin.RouterGroup, h *CustomerHandler, requireCustomer gin.HandlerFunc, loginRateLimit gin.HandlerFunc) {
|
|
group := rg.Group("/auth/customer")
|
|
group.POST("/register", loginRateLimit, h.Register)
|
|
group.POST("/login", loginRateLimit, h.Login)
|
|
group.POST("/refresh", h.Refresh)
|
|
group.POST("/logout", h.Logout)
|
|
group.GET("/me", requireCustomer, h.Me)
|
|
}
|