Skip to content

Commit

Permalink
oauth2: added WEBSMTP config option
Browse files Browse the repository at this point in the history
  • Loading branch information
zeim839 committed Jan 27, 2024
1 parent ae2532a commit 23f5b19
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion oauth2/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ type Config struct {
NOTIF_EMAIL_ADDR string
SECRET string
PORT string
WEBSMTP string
}

// GetDefaultConfig populates a Config instance with default configuration
Expand All @@ -25,6 +26,7 @@ func GetDefaultConfig() (c Config) {
c.NOTIF_EMAIL_ADDR = "[email protected]"
c.SECRET = "369369369369369369"
c.PORT = "8080"
c.WEBSMTP = "http://localhost:3001"
return c
}

Expand All @@ -36,7 +38,7 @@ func GetConfig() Config {
log.Println("No .env file found")
}

if mode := os.Getenv("GIN_MODE"); mode == "debug" || mode == "production" {
if mode := os.Getenv("GIN_MODE"); mode == "debug" || mode == "release" {
c.GIN_MODE = mode
}
if uri := os.Getenv("MONGO_URI"); uri != "" {
Expand All @@ -54,6 +56,9 @@ func GetConfig() Config {
if port := os.Getenv("PORT"); port != "" {
c.PORT = port
}
if websmtp := os.Getenv("WEBSMTP"); websmtp != "" {
c.WEBSMTP = websmtp
}

return c
}

0 comments on commit 23f5b19

Please sign in to comment.