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:
DATABASE_URL: postgres://postgres:password@localhost:5432/postgres
- name: build
run: make
env:
DATABASE_URL: postgres://postgres:password@localhost:5432/postgres
# - name: build frontend
# run: make frontend
- name: build frontend
run: make frontend
- name: run tests
run: make test

View file

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

View file

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