fix: string/number hacks
This commit is contained in:
parent
669a6eaf6d
commit
608cfad501
|
@ -87,8 +87,14 @@ func githubRestVerifyMiddleware(db *gorm.DB) mux.MiddlewareFunc {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
appId, ok := claims["iss"].(string)
|
var appId string
|
||||||
if !ok {
|
|
||||||
|
switch v := claims["iss"].(type) {
|
||||||
|
case string:
|
||||||
|
appId = v
|
||||||
|
case float64:
|
||||||
|
appId = strconv.FormatFloat(v, 'f', -1, 64)
|
||||||
|
default:
|
||||||
http.Error(w, "Invalid JWT", http.StatusUnauthorized)
|
http.Error(w, "Invalid JWT", http.StatusUnauthorized)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue