File tree Expand file tree Collapse file tree 3 files changed +9
-0
lines changed Expand file tree Collapse file tree 3 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ module github.com/markbates/goth
33go 1.18
44
55require (
6+ github.com/go-chi/chi/v5 v5.1.0
67 github.com/golang-jwt/jwt/v4 v4.2.0
78 github.com/gorilla/mux v1.6.2
89 github.com/gorilla/pat v0.0.0-20180118222023-199c85a7f6d1
Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
99github.com/decred/dcrd/crypto/blake256 v1.0.1 /go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo =
1010github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs =
1111github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 /go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0 =
12+ github.com/go-chi/chi/v5 v5.1.0 h1:acVI1TYaD+hhedDJ3r54HyA6sExp3HfXq7QWEEY/xMw =
13+ github.com/go-chi/chi/v5 v5.1.0 /go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8 =
1214github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU =
1315github.com/goccy/go-json v0.10.2 /go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I =
1416github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU =
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import (
2222 "os"
2323 "strings"
2424
25+ "github.com/go-chi/chi/v5"
2526 "github.com/gorilla/mux"
2627 "github.com/gorilla/sessions"
2728 "github.com/markbates/goth"
@@ -282,6 +283,11 @@ func getProviderName(req *http.Request) (string, error) {
282283 return p , nil
283284 }
284285
286+ // try to get it from the url param "provider", when req is routed through 'chi'
287+ if p := chi .URLParam (req , "provider" ); p != "" {
288+ return p , nil
289+ }
290+
285291 // try to get it from the go-context's value of providerContextKey key
286292 if p , ok := req .Context ().Value (ProviderParamKey ).(string ); ok {
287293 return p , nil
You can’t perform that action at this time.
0 commit comments