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