feat: const session secret key in dev

This commit is contained in:
email
2022-03-29 07:30:29 +08:00
parent 8f76120e4e
commit 1cebf1dbd0
5 changed files with 9 additions and 17 deletions

View File

@ -11,8 +11,8 @@ import (
)
func (s *Server) registerUserRoutes(g *echo.Group) {
// GET /api/user/me is used to check if the user is logged in.
g.GET("/user/me", func(c echo.Context) error {
// /api/user/me is used to check if the user is logged in,
userSessionId := c.Get(getUserIdContextKey())
if userSessionId == nil {
return echo.NewHTTPError(http.StatusUnauthorized, "Missing session")