Skip to content

Commit

Permalink
wip: generate provider url
Browse files Browse the repository at this point in the history
  • Loading branch information
katallaxie committed Jan 28, 2024
1 parent 63de979 commit dc368cb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ require (
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/uuid v1.5.0 // indirect
github.com/gordonklaus/ineffassign v0.0.0-20230610083614-0e73809eb601 // indirect
github.com/gorilla/context v1.1.1 // indirect
github.com/gorilla/mux v1.6.2 // indirect
github.com/gorilla/securecookie v1.1.1 // indirect
github.com/gorilla/sessions v1.1.1 // indirect
github.com/gostaticanalysis/analysisutil v0.7.1 // indirect
github.com/gostaticanalysis/comment v1.4.2 // indirect
github.com/gostaticanalysis/forcetypeassert v0.1.0 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,9 @@ github.com/gorilla/mux v1.6.2 h1:Pgr17XVTNXAk3q/r4CpKzC5xBM/qW1uVLV+IhRZpIIk=
github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/pat v0.0.0-20180118222023-199c85a7f6d1 h1:LqbZZ9sNMWVjeXS4NN5oVvhMjDyLhmA1LG86oSo+IqY=
github.com/gorilla/pat v0.0.0-20180118222023-199c85a7f6d1/go.mod h1:YeAe0gNeiNT5hoiZRI4yiOky6jVdNvfO2N6Kav/HmxY=
github.com/gorilla/securecookie v1.1.1 h1:miw7JPhV+b/lAHSXz4qd/nN9jRiAFV5FwjeKyCS8BvQ=
github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4=
github.com/gorilla/sessions v1.1.1 h1:YMDmfaK68mUixINzY/XjscuJ47uXFWSSHzFbBQM0PrE=
github.com/gorilla/sessions v1.1.1/go.mod h1:8KCfur6+4Mqcc6S0FEfKuN15Vl5MgXW92AE8ovaJD0w=
github.com/gostaticanalysis/analysisutil v0.7.1 h1:ZMCjoue3DtDWQ5WyU16YbjbQEQ3VuzwxALrpYd+HeKk=
github.com/gostaticanalysis/analysisutil v0.7.1/go.mod h1:v21E3hY37WKMGSnbsw2S/ojApNWb6C1//mXO48CXbVc=
Expand Down
5 changes: 3 additions & 2 deletions goth.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func NewBeginAuthHandler(config ...Config) fiber.Handler {

// GetAuthURLFromContext returns the provider specific authentication URL.
func GetAuthURLFromContext(c *fiber.Ctx, session SessionStore) (string, error) {
p := c.Query(provider)
p := c.Params(provider)
if p == "" {
return "", ErrMissingProviderName
}
Expand Down Expand Up @@ -212,6 +212,7 @@ type Config struct {
var ConfigDefault = Config{
ErrorHandler: defaultErrorHandler,
BeginAuthHandler: BeginAuthHandler{},
Session: NewSessionStore(session.New(defaultSessionConfig)),
}

// default ErrorHandler that process return error from fiber.Handler
Expand All @@ -227,7 +228,7 @@ var defaultSessionConfig = session.Config{
// Helper function to set default values
func configDefault(config ...Config) Config {
if len(config) < 1 {
return configDefault()
return ConfigDefault
}

// Override default config
Expand Down

0 comments on commit dc368cb

Please sign in to comment.