Skip to content

Commit

Permalink
Add support for oauth2 beind proxy (#730)
Browse files Browse the repository at this point in the history
This change uses the public_url config value to create the oauth2
callback url.
  • Loading branch information
KnisterPeter authored Mar 18, 2024
1 parent a793ea3 commit 81cfd92
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,13 @@ func New(c *Config) (*Server, error) {
mux.Handle(pat.Post("/api/simulate/:owner/:repo/:number"), hatpear.Try(simulateHandler))
mux.Handle(pat.Get(oauth2.DefaultRoute), oauth2.NewHandler(
oauth2.GetConfig(c.Github, nil),
oauth2.ForceTLS(forceTLS),
oauth2.WithStore(&oauth2.SessionStateStore{
Sessions: sessions,
}),
oauth2.OnLogin(handler.Login(c.Github, basePath, sessions)),
oauth2.WithRedirectURL(publicURL.ResolveReference(&url.URL{
Path: oauth2.DefaultRoute,
}).String()),
))

// additional client routes
Expand Down

0 comments on commit 81cfd92

Please sign in to comment.