mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-01 14:43:07 +02:00
cleanup code, redirect to auth page when need
This commit is contained in:
14
cmd/main.go
14
cmd/main.go
@@ -109,16 +109,16 @@ func main() {
|
||||
return
|
||||
}
|
||||
|
||||
if common.APIJWTSecret == nil {
|
||||
logging.Warn().Msg("API JWT secret is empty, authentication is disabled")
|
||||
}
|
||||
|
||||
cfg.Start()
|
||||
config.WatchChanges()
|
||||
|
||||
// Initialize authentication providers
|
||||
if err := auth.Initialize(); err != nil {
|
||||
logging.Warn().Err(err).Msg("Failed to initialize authentication providers")
|
||||
if !auth.IsEnabled() {
|
||||
logging.Warn().Msg("authentication is disabled, please set API_JWT_SECRET or OIDC_* to enable authentication")
|
||||
} else {
|
||||
// Initialize authentication providers
|
||||
if err := auth.Initialize(); err != nil {
|
||||
logging.Fatal().Err(err).Msg("Failed to initialize authentication providers")
|
||||
}
|
||||
}
|
||||
|
||||
sig := make(chan os.Signal, 1)
|
||||
|
||||
Reference in New Issue
Block a user