Fix multiple origins issue
This commit is contained in:
parent
483acde546
commit
f49b947884
@ -134,6 +134,7 @@ impl AppConfig {
|
|||||||
|
|
||||||
/// Get auth cookie domain
|
/// Get auth cookie domain
|
||||||
pub fn cookie_domain(&self) -> Option<String> {
|
pub fn cookie_domain(&self) -> Option<String> {
|
||||||
|
if cfg!(debug_assertions) {
|
||||||
let domain = self.website_origin.split_once("://")?.1;
|
let domain = self.website_origin.split_once("://")?.1;
|
||||||
Some(
|
Some(
|
||||||
domain
|
domain
|
||||||
@ -142,6 +143,10 @@ impl AppConfig {
|
|||||||
.unwrap_or(domain)
|
.unwrap_or(domain)
|
||||||
.to_string(),
|
.to_string(),
|
||||||
)
|
)
|
||||||
|
} else {
|
||||||
|
// In release mode, the web app is hosted on the same origin as the API
|
||||||
|
None
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get app secret
|
/// Get app secret
|
||||||
|
Loading…
Reference in New Issue
Block a user