Skip to content

Commit

Permalink
Merge pull request #910 from porter-dev/master
Browse files Browse the repository at this point in the history
Empty GH App config fix -> staging
  • Loading branch information
abelanger5 authored Jul 22, 2021
2 parents 8b4c643 + 216d186 commit 8f6f59f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion server/router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/porter-dev/porter/server/api"
mw "github.com/porter-dev/porter/server/middleware"
"github.com/porter-dev/porter/server/middleware/requestlog"
"golang.org/x/oauth2"
)

// New creates a new Chi router instance and registers all routes supported by the
Expand All @@ -21,9 +22,15 @@ func New(a *api.App) *chi.Mux {
l := a.Logger
r := chi.NewRouter()

var ghAppConf *oauth2.Config

if a.GithubAppConf != nil {
ghAppConf = &a.GithubAppConf.Config
}

auth := mw.NewAuth(a.Store, a.ServerConf.CookieName, &token.TokenGeneratorConf{
TokenSecret: a.ServerConf.TokenGeneratorSecret,
}, a.Repo, &a.GithubAppConf.Config)
}, a.Repo, ghAppConf)

r.Route("/api", func(r chi.Router) {
r.Use(mw.ContentTypeJSON)
Expand Down

0 comments on commit 8f6f59f

Please sign in to comment.