We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tiedot/httpapi/jwt.go
Line 244 in 21707c0
if the first argument to pass type type MapClaims map[string]interface{} example how here:
type MapClaims map[string]interface{}
if !sliceContainsStr(tokenClaims[JWT_ENDPOINTS_ATTR], url) { http.Error(w, "", http.StatusUnauthorized) return
It switch possibleSlice.(type) { will return interface{} accordingly, the function will never return true
switch possibleSlice.(type) {
interface{}
func sliceContainsStr(possibleSlice interface{}, str string) bool { switch possibleSlice.(type) { case []string: for _, elem := range possibleSlice.([]string) { if elem == str { return true } } } return false }
I suggest so:
func sliceContainsStr(possibleSlice interface{}, str string) bool { if possibleSlice, exist := possibleSlice.([]string); exist { for _, elem := range possibleSlice { if elem == str { return true } } } return false }
The text was updated successfully, but these errors were encountered:
how
Sorry, something went wrong.
agoalofalife
No branches or pull requests
tiedot/httpapi/jwt.go
Line 244 in 21707c0
if the first argument to pass type
type MapClaims map[string]interface{}
example how here:
It
switch possibleSlice.(type) {
will returninterface{}
accordingly, the function will never return true
I suggest so:
The text was updated successfully, but these errors were encountered: