users: set a less restrictive domain on the cookie
Signed-off-by: ATechnoHazard <amolele@gmail.com>
This commit is contained in:
parent
ebe7bf4594
commit
9e7fc110ea
@ -1,8 +1,6 @@
|
|||||||
use jirachi::collision_resistant::Jirachi;
|
use jirachi::collision_resistant::Jirachi;
|
||||||
use jirachi::Wishable;
|
use jirachi::Wishable;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
pub fn get_random_id() -> String {
|
pub fn get_random_id() -> String {
|
||||||
let mut jirachi = Jirachi::new().unwrap();
|
let mut jirachi = Jirachi::new().unwrap();
|
||||||
jirachi.wish().unwrap()
|
jirachi.wish().unwrap()
|
||||||
|
@ -7,7 +7,8 @@ pub fn get_session_id(ck: &mut Cookies) -> String {
|
|||||||
Some(c) => c.value().to_string(),
|
Some(c) => c.value().to_string(),
|
||||||
None => {
|
None => {
|
||||||
let user_id = phonetic_key::get_random_id();
|
let user_id = phonetic_key::get_random_id();
|
||||||
ck.add_private(Cookie::new("session", user_id.clone()));
|
let cookie = Cookie::build("session", user_id.clone()).domain("katb.in").permanent().finish();
|
||||||
|
ck.add_private(cookie);
|
||||||
user_id
|
user_id
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user