update cookie stuff
This commit is contained in:
parent
f5a69034f8
commit
12e80c2698
1 changed files with 7 additions and 0 deletions
|
@ -6,6 +6,8 @@ use rocket::form::Form;
|
||||||
|
|
||||||
use rocket::http::{Cookie, CookieJar};
|
use rocket::http::{Cookie, CookieJar};
|
||||||
|
|
||||||
|
use rocket::time::Duration;
|
||||||
|
|
||||||
use diesel::prelude::*;
|
use diesel::prelude::*;
|
||||||
|
|
||||||
use crate::db;
|
use crate::db;
|
||||||
|
@ -35,6 +37,11 @@ pub fn post_login(jar: &CookieJar<'_>, input: Form<FormLogin>) -> Template {
|
||||||
jar.add_private(Cookie::build(
|
jar.add_private(Cookie::build(
|
||||||
"blackmail_data",
|
"blackmail_data",
|
||||||
format!("{}:{}:{}", account_id_username_val.1, account_id_user_id_val.0, account_id_user_id_val.1))
|
format!("{}:{}:{}", account_id_username_val.1, account_id_user_id_val.0, account_id_user_id_val.1))
|
||||||
|
.path("/")
|
||||||
|
// should probably make this true when we get into production
|
||||||
|
.secure(false)
|
||||||
|
.http_only(true)
|
||||||
|
.max_age(Duration::days(365))
|
||||||
.finish());
|
.finish());
|
||||||
|
|
||||||
return Template::render("login", context! {
|
return Template::render("login", context! {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue