feature/frontend-login #10
@@ -3,7 +3,9 @@ use std::net::IpAddr;
|
||||
use config::{Config, ConfigError};
|
||||
use tracing::warn;
|
||||
|
||||
use crate::configs::key::{SERVER_COOKIES_SECURE_KEY, SERVER_CORS_ALLOWED_ORIGINS_KEY, SERVER_SERVE_OPENAPI_KEY};
|
||||
use crate::configs::key::{
|
||||
SERVER_COOKIES_SECURE_KEY, SERVER_CORS_ALLOWED_ORIGINS_KEY, SERVER_SERVE_OPENAPI_KEY,
|
||||
};
|
||||
|
||||
use super::{
|
||||
FromConfig,
|
||||
@@ -94,7 +96,7 @@ impl FromConfig for ServerSettings {
|
||||
.inspect(|is_secure| {
|
||||
if !*is_secure {
|
||||
warn!("Cookie 'secure' flag is disabled; this is not recommended in production environments.");
|
||||
}
|
||||
}
|
||||
})
|
||||
.unwrap_or_else(|err| {
|
||||
const DEFAULT_COOKIES_SECURE: bool = true;
|
||||
@@ -125,9 +127,7 @@ impl FromConfig for ServerSettings {
|
||||
cors: CORSSettings {
|
||||
allowed_origins: vec![],
|
||||
},
|
||||
cookies: CookiesSettings {
|
||||
secure: true,
|
||||
},
|
||||
cookies: CookiesSettings { secure: true },
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user