}
type ApiConfig struct {
- Domain string `toml:"domain"`
- JwtSecret string `toml:"jwt_secret"`
+ api.Config
}
type Config struct {
- App AppConfig
- Api ApiConfig
- Db db.DBConfig
+ App AppConfig
+ Api ApiConfig
+ Mail api.MailConfig
+ Db db.DBConfig
+ Redis db.RedisConfig
utils.LogConfiguration
Address string
App: AppConfig{
PublicDir: "./public",
},
- Api: ApiConfig{
- JwtSecret: "secret",
- },
}
c.LogConfiguration.SetToDefaults()
panic(err)
}
- api.SetJwtSecretKey(C.Api.JwtSecret)
+ api.SetConfig(C.Api.Config)
+ api.SetMailConfig(C.Mail)
- db.Init(C.Db)
+ db.Init(C.Db, C.Redis)
- if C.Mode == "production" {
+ if C.Mode == "prod" {
+ gin.DisableConsoleColor()
gin.SetMode(gin.ReleaseMode)
}
"/",
"/signup",
"/signin",
+ "/confirm",
+ "/reset-password",
+ "/change-password",
"/signout",
"/me",
+ "/account",
"/otp/enroll",
"/otp/validate",
+ "/not_confirmed",
}
for _, route := range availableRoutes {