Skip to content

Commit

Permalink
feat: jwt paths
Browse files Browse the repository at this point in the history
  • Loading branch information
pupilcc committed Jul 30, 2024
1 parent 3c1079d commit 30d4270
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions config/jwt.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@ package config

import "github.com/labstack/echo/v4"

var skipTokenPaths = map[string]bool{
"/": true,
"/health": true,
"/login": true,
"/dl/:uuid": true,
var skipTokenPaths = []string{
"/",
"/health",
"/login",
"/dl/:code",
}

func Skip(c echo.Context) bool {
path := c.Path()
if _, ok := skipTokenPaths[path]; ok {
return true
for _, p := range skipTokenPaths {
if path == p {
return true
}
}

return false
Expand Down

0 comments on commit 30d4270

Please sign in to comment.