Set authentication cookie as secure
This commit is contained in:
parent
6f014ef238
commit
f9899c1aeb
1 changed files with 3 additions and 0 deletions
|
|
@ -237,6 +237,7 @@ pub async fn sign_up_validation(
|
|||
{
|
||||
db::user::ValidationResult::Ok(token, user_id) => {
|
||||
let cookie = Cookie::build((consts::COOKIE_AUTH_TOKEN_NAME, token))
|
||||
.secure(true)
|
||||
.same_site(cookie::SameSite::Strict);
|
||||
jar = jar.add(cookie);
|
||||
let user = connection.load_user(user_id).await?;
|
||||
|
|
@ -367,6 +368,7 @@ pub async fn sign_in_post(
|
|||
}
|
||||
db::user::SignInResult::Ok(token, _user_id) => {
|
||||
let cookie = Cookie::build((consts::COOKIE_AUTH_TOKEN_NAME, token))
|
||||
.secure(true)
|
||||
.same_site(cookie::SameSite::Strict);
|
||||
Ok((
|
||||
jar.add(cookie),
|
||||
|
|
@ -974,6 +976,7 @@ pub async fn email_revalidation(
|
|||
{
|
||||
db::user::ValidationResult::Ok(token, user_id) => {
|
||||
let cookie = Cookie::build((consts::COOKIE_AUTH_TOKEN_NAME, token))
|
||||
.secure(true)
|
||||
.same_site(cookie::SameSite::Strict);
|
||||
jar = jar.add(cookie);
|
||||
let user = connection.load_user(user_id).await?;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue