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
|
||||
}
|
||||
|
||||
appId, ok := claims["iss"].(string)
|
||||
if !ok {
|
||||
var appId string
|
||||
|
||||
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)
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue