Documentation
¶
Overview ¶
Package handlers provides HTTP handlers for the golang-ecolabel-backend project.
Package handlers provides HTTP handlers for the golang-ecolabel-backend project.
Index ¶
- func HandleDashboard(w http.ResponseWriter, r *http.Request)
- func HandleGetCSRFToken(w http.ResponseWriter, r *http.Request)
- func HandleGetSessionValue(w http.ResponseWriter, r *http.Request)
- func HandleLogin(w http.ResponseWriter, r *http.Request)
- func HandleSetSessionValue(w http.ResponseWriter, r *http.Request)
- func HandleSubmit(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleDashboard ¶
func HandleDashboard(w http.ResponseWriter, r *http.Request)
HandleDashboard is an HTTP handler that returns a welcome message for the dashboard. This handler requires JWT authentication and should be protected by the JwtAuthMiddleware.
func HandleGetCSRFToken ¶
func HandleGetCSRFToken(w http.ResponseWriter, r *http.Request)
func HandleGetSessionValue ¶
func HandleGetSessionValue(w http.ResponseWriter, r *http.Request)
HandleGetSessionValue retrieves a value from the session.
func HandleLogin ¶
func HandleLogin(w http.ResponseWriter, r *http.Request)
HandleLogin is an HTTP handler that processes login requests. It reads a JSON request body containing a username and password, authenticates the credentials using the userService, and returns a JSON response with a JWT token if the authentication is successful.
func HandleSetSessionValue ¶
func HandleSetSessionValue(w http.ResponseWriter, r *http.Request)
HandleSetSessionValue sets a value in the session.
func HandleSubmit ¶
func HandleSubmit(w http.ResponseWriter, r *http.Request)
Types ¶
This section is empty.