Update permission issues

This commit is contained in:
LinkLeong 2023-07-03 10:08:05 +01:00
parent 28d724731a
commit dfeed76a66

View file

@ -79,7 +79,10 @@ func InitV2Router() http.Handler {
}, },
TokenLookupFuncs: []echo_middleware.ValuesExtractor{ TokenLookupFuncs: []echo_middleware.ValuesExtractor{
func(c echo.Context) ([]string, error) { func(c echo.Context) ([]string, error) {
return []string{c.Request().Header.Get(echo.HeaderAuthorization)}, nil if len(c.Request().Header.Get(echo.HeaderAuthorization)) > 0 {
return []string{c.Request().Header.Get(echo.HeaderAuthorization)}, nil
}
return []string{c.QueryParam("token")}, nil
}, },
}, },
})) }))