mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2026-07-15 22:41:14 +00:00
refactor: rework the way trusted proxies ip work (#1007)
This commit is contained in:
@@ -30,6 +30,16 @@ func (app *BootstrapApp) setupRouter() error {
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to set trusted proxies: %w", err)
|
||||
}
|
||||
|
||||
app.runtime.TrustedProxiesConfigured = true
|
||||
} else {
|
||||
err := engine.SetTrustedProxies(nil)
|
||||
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to set trusted proxies: %w", err)
|
||||
}
|
||||
|
||||
app.log.App.Warn().Msg("Trusted proxies are not configured, IP access controls will NOT work")
|
||||
}
|
||||
|
||||
middlewareProvideFor := []any{
|
||||
|
||||
Reference in New Issue
Block a user