cross-site config
This commit is contained in:
parent
5df82f7a8f
commit
5d6e926ac8
@ -132,7 +132,9 @@ async fn login(
|
|||||||
let s = Uuid::new_v4();
|
let s = Uuid::new_v4();
|
||||||
let mut locked = state.session.lock().await;
|
let mut locked = state.session.lock().await;
|
||||||
locked.insert(s.clone(), Instant::now() + Duration::from_secs(SESSION_ACTIVE_TIME));
|
locked.insert(s.clone(), Instant::now() + Duration::from_secs(SESSION_ACTIVE_TIME));
|
||||||
cookies.add(Cookie::new(COOKIE_NAME, s.to_string()));
|
let mut new_cookie = Cookie::new(COOKIE_NAME, s.to_string());
|
||||||
|
new_cookie.set_domain(".aaronhu.cn");
|
||||||
|
cookies.add(new_cookie);
|
||||||
if let Some(original_uri) = params.get("original_url") {
|
if let Some(original_uri) = params.get("original_url") {
|
||||||
return Ok(Redirect::to(&original_uri));
|
return Ok(Redirect::to(&original_uri));
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user