Skip to content

Commit

Permalink
add app host env var
Browse files Browse the repository at this point in the history
  • Loading branch information
caioeverest committed Jan 16, 2024
1 parent f7283fc commit 7b9a3b4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/user/oauth_providers.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package user

import (
"fmt"
"log/slog"

"github.com/markbates/goth"
Expand All @@ -17,7 +18,7 @@ func registerProviders() {
github.New(
cfg.Providers.Github.Key,
cfg.Providers.Github.Secret,
"http://localhost:8000/auth/github/callback",
fmt.Sprintf("%s/auth/github/callback", cfg.AppHost),
"user",
),
)
Expand Down
1 change: 1 addition & 0 deletions lib/config/config.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package config

type Config struct {
AppHost string `env:"HOST" envDefault:"http://localhost:8000"`
HTTPPort int `env:"PORT" envDefault:"8000"`
Environment string `env:"ENVIRONMENT" envDefault:"unknown"`
LogLevel string `env:"LOG_LEVEL" envDefault:"debug"`
Expand Down

0 comments on commit 7b9a3b4

Please sign in to comment.