clear cookie after account deletion and CI: skip build

This commit is contained in:
realaravinth 2021-07-09 11:49:01 +05:30
parent 4c293bdb5a
commit 67a35a6e43
No known key found for this signature in database
GPG Key ID: AD9F0F08E855ED88
3 changed files with 9 additions and 15 deletions

View File

@ -73,13 +73,8 @@ jobs:
env: env:
DATABASE_URL: postgres://postgres:password@localhost:5432/postgres DATABASE_URL: postgres://postgres:password@localhost:5432/postgres
- name: build - name: build frontend
run: make run: make frontend
env:
DATABASE_URL: postgres://postgres:password@localhost:5432/postgres
# - name: build frontend
# run: make frontend
- name: run tests - name: run tests
run: make test run: make test

View File

@ -44,14 +44,13 @@ async fn delete_account(
.fetch_one(&data.db) .fetch_one(&data.db)
.await; .await;
id.forget();
match rec { match rec {
Ok(s) => { Ok(s) => {
if Config::verify(&s.password, &payload.password)? { if Config::verify(&s.password, &payload.password)? {
sqlx::query!("DELETE FROM mcaptcha_users WHERE name = ($1)", &username) sqlx::query!("DELETE FROM mcaptcha_users WHERE name = ($1)", &username)
.execute(&data.db) .execute(&data.db)
.await?; .await?;
id.forget();
Ok(HttpResponse::Ok()) Ok(HttpResponse::Ok())
} else { } else {
Err(ServiceError::WrongPassword) Err(ServiceError::WrongPassword)

View File

@ -83,12 +83,12 @@ lazy_static! {
} }
pub static OPEN_API_DOC: &str = env!("OPEN_API_DOCS"); pub const OPEN_API_DOC: &str = env!("OPEN_API_DOCS");
pub static GIT_COMMIT_HASH: &str = env!("GIT_HASH"); pub const GIT_COMMIT_HASH: &str = env!("GIT_HASH");
pub static VERSION: &str = env!("CARGO_PKG_VERSION"); pub const VERSION: &str = env!("CARGO_PKG_VERSION");
pub static PKG_NAME: &str = env!("CARGO_PKG_NAME"); pub const PKG_NAME: &str = env!("CARGO_PKG_NAME");
pub static PKG_DESCRIPTION: &str = env!("CARGO_PKG_DESCRIPTION"); pub const PKG_DESCRIPTION: &str = env!("CARGO_PKG_DESCRIPTION");
pub static PKG_HOMEPAGE: &str = env!("CARGO_PKG_HOMEPAGE"); pub const PKG_HOMEPAGE: &str = env!("CARGO_PKG_HOMEPAGE");
pub const CACHE_AGE: u32 = 604800; pub const CACHE_AGE: u32 = 604800;