Skip to content

Commit

Permalink
include protocol in base url
Browse files Browse the repository at this point in the history
  • Loading branch information
linomp committed Aug 10, 2024
1 parent dc3d8b2 commit c95e9d7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ func main() {
w.Write([]byte(html))
})

log.Printf("Running on http://%s\n", os.Getenv("BASE_URL"))
log.Printf("Try oauth demo on http://%s/oauthdemo\n", os.Getenv("BASE_URL"))
log.Printf("Running on %s\n", os.Getenv("BASE_URL"))
log.Printf("Try oauth demo on %s/oauthdemo\n", os.Getenv("BASE_URL"))

log.Fatal(http.ListenAndServe(fmt.Sprintf("0.0.0.0:%s", os.Getenv("PORT")), mux))
}
2 changes: 1 addition & 1 deletion src/oauthdemo.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func init() {

// Initialize the OAuth2 config once during package initialization
googleOauthConfig = &oauth2.Config{
RedirectURL: fmt.Sprintf("http://%s/google-oauth-callback", os.Getenv("BASE_URL")),
RedirectURL: fmt.Sprintf("%s/google-oauth-callback", os.Getenv("BASE_URL")),
ClientID: os.Getenv("GOOGLE_CLIENT_ID"),
ClientSecret: os.Getenv("GOOGLE_CLIENT_SECRET"),
Scopes: []string{
Expand Down

0 comments on commit c95e9d7

Please sign in to comment.