Compare commits
54 Commits
c6c0000c18
...
renovate/t
Author | SHA1 | Date | |
---|---|---|---|
1cac3fdd85 | |||
776d24031b | |||
991a3340e5 | |||
012dc3eb3c | |||
3f43dea93c | |||
8e7ce2f6bc | |||
a1c047f936 | |||
f3f7ebae35 | |||
60fd656b94 | |||
9f25e39cca | |||
0c178daf55 | |||
8dbc5c452e | |||
e5ee0b4d77 | |||
bc3bfe08c6 | |||
f2d391a430 | |||
764a7d94e3 | |||
aea6a64896 | |||
9c728f312b | |||
c7d4056dc3 | |||
555e72ef22 | |||
f35926dfb6 | |||
067ac5181b | |||
b83314f540 | |||
3203d12aac | |||
fae4e144f4 | |||
8179c7a6d6 | |||
a42b887a74 | |||
84ed2c6754 | |||
126920b41f | |||
24fa207005 | |||
40901c55db | |||
fd870317dd | |||
4f6d4abb43 | |||
94da037d55 | |||
88e8c9bf05 | |||
40bbfd9adf | |||
c803ccb212 | |||
db98ff4ed2 | |||
44c54112b6 | |||
cdcb86913f | |||
fcfe457514 | |||
55745f5845 | |||
2ee8bc337f | |||
e441480bf7 | |||
c84817d190 | |||
f615291950 | |||
b95aa90836 | |||
22d2bbfc41 | |||
069ca185cc | |||
9b8f2bd3cf | |||
6c9a0db8d5 | |||
877b0c56b3 | |||
25cae9b006 | |||
fdd11e7eae |
@ -24,7 +24,7 @@ steps:
|
||||
commands:
|
||||
# Build website
|
||||
- cd geneit_app
|
||||
- npm install --legacy-peer-deps # TODO : remove when mui-color-input is updated
|
||||
- npm install
|
||||
- GENERATE_SOURCEMAP=false npm run build
|
||||
# Install AWS
|
||||
- curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
|
||||
|
2722
geneit_app/package-lock.json
generated
2722
geneit_app/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -10,47 +10,47 @@
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"@emotion/react": "^11.13.3",
|
||||
"@emotion/styled": "^11.13.0",
|
||||
"@fontsource/roboto": "^5.2.5",
|
||||
"@fullcalendar/core": "^6.1.15",
|
||||
"@fullcalendar/daygrid": "^6.1.15",
|
||||
"@fullcalendar/interaction": "^6.1.15",
|
||||
"@fullcalendar/list": "^6.1.15",
|
||||
"@fullcalendar/react": "^6.1.15",
|
||||
"@mdi/js": "^7.2.96",
|
||||
"@emotion/react": "^11.14.0",
|
||||
"@emotion/styled": "^11.14.0",
|
||||
"@fontsource/roboto": "^5.2.6",
|
||||
"@fullcalendar/core": "^6.1.17",
|
||||
"@fullcalendar/daygrid": "^6.1.17",
|
||||
"@fullcalendar/interaction": "^6.1.17",
|
||||
"@fullcalendar/list": "^6.1.17",
|
||||
"@fullcalendar/react": "^6.1.17",
|
||||
"@mdi/js": "^7.4.47",
|
||||
"@mdi/react": "^1.6.1",
|
||||
"@mui/icons-material": "^7.0.0",
|
||||
"@mui/lab": "^7.0.0-beta.9",
|
||||
"@mui/material": "^7.0.0",
|
||||
"@mui/x-data-grid": "^7.28.2",
|
||||
"@mui/x-date-pickers": "^7.28.2",
|
||||
"@mui/x-tree-view": "^7.28.1",
|
||||
"@mui/icons-material": "^7.1.2",
|
||||
"@mui/lab": "^7.0.0-beta.14",
|
||||
"@mui/material": "^7.1.2",
|
||||
"@mui/x-data-grid": "^7.29.6",
|
||||
"@mui/x-date-pickers": "^7.29.4",
|
||||
"@mui/x-tree-view": "^7.29.1",
|
||||
"date-and-time": "^3.6.0",
|
||||
"dayjs": "^1.11.13",
|
||||
"email-validator": "^2.0.4",
|
||||
"filesize": "^10.1.6",
|
||||
"jspdf": "^3.0.1",
|
||||
"mui-color-input": "^6.0.0",
|
||||
"mui-color-input": "^7.0.0",
|
||||
"react": "^19.0.0",
|
||||
"react-dom": "^19.0.0",
|
||||
"react-easy-crop": "^5.4.1",
|
||||
"react-qr-code": "^2.0.14",
|
||||
"react-easy-crop": "^5.4.2",
|
||||
"react-qr-code": "^2.0.16",
|
||||
"react-router-dom": "^7.4.0",
|
||||
"react-zoom-pan-pinch": "^3.7.0",
|
||||
"svg2pdf.js": "^2.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.21.0",
|
||||
"@eslint/js": "^9.29.0",
|
||||
"@types/react": "^19.0.12",
|
||||
"@types/react-dom": "^19.0.4",
|
||||
"@vitejs/plugin-react": "^4.3.4",
|
||||
"eslint": "^9.21.0",
|
||||
"eslint-plugin-react-hooks": "^5.1.0",
|
||||
"eslint-plugin-react-refresh": "^0.4.19",
|
||||
"@vitejs/plugin-react": "^4.6.0",
|
||||
"eslint": "^9.29.0",
|
||||
"eslint-plugin-react-hooks": "^5.2.0",
|
||||
"eslint-plugin-react-refresh": "^0.4.20",
|
||||
"globals": "^16.0.0",
|
||||
"typescript": "^5.8.2",
|
||||
"typescript-eslint": "^8.24.1",
|
||||
"vite": "^6.2.3"
|
||||
"typescript": "^5.8.3",
|
||||
"typescript-eslint": "^8.35.1",
|
||||
"vite": "^6.3.5"
|
||||
}
|
||||
}
|
||||
|
@ -43,9 +43,13 @@ export function BaseAuthenticatedPage(): React.ReactElement {
|
||||
setAnchorEl(null);
|
||||
};
|
||||
|
||||
const signOut = () => {
|
||||
const signOut = async () => {
|
||||
handleCloseMenu();
|
||||
AuthApi.SignOut();
|
||||
try {
|
||||
await AuthApi.SignOut();
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
navigate("/");
|
||||
auth.setSignedIn(false);
|
||||
};
|
||||
|
49
geneit_backend/Cargo.lock
generated
49
geneit_backend/Cargo.lock
generated
@ -64,7 +64,7 @@ dependencies = [
|
||||
"mime",
|
||||
"percent-encoding",
|
||||
"pin-project-lite",
|
||||
"rand 0.9.0",
|
||||
"rand 0.9.1",
|
||||
"sha1",
|
||||
"smallvec",
|
||||
"tokio",
|
||||
@ -390,9 +390,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "anyhow"
|
||||
version = "1.0.97"
|
||||
version = "1.0.98"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f"
|
||||
checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487"
|
||||
|
||||
[[package]]
|
||||
name = "arbitrary"
|
||||
@ -709,9 +709,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
||||
|
||||
[[package]]
|
||||
name = "chrono"
|
||||
version = "0.4.40"
|
||||
version = "0.4.41"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1a7964611d71df112cb1730f2ee67324fcf4d0fc6606acbbe9bfe06df124637c"
|
||||
checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d"
|
||||
dependencies = [
|
||||
"android-tzdata",
|
||||
"iana-time-zone",
|
||||
@ -744,9 +744,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "clap"
|
||||
version = "4.5.35"
|
||||
version = "4.5.40"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d8aa86934b44c19c50f87cc2790e19f54f7a67aedb64101c2e1a2e5ecfb73944"
|
||||
checksum = "40b6887a1d8685cebccf115538db5c0efe625ccac9696ad45c409d96566e910f"
|
||||
dependencies = [
|
||||
"clap_builder",
|
||||
"clap_derive",
|
||||
@ -754,9 +754,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "clap_builder"
|
||||
version = "4.5.35"
|
||||
version = "4.5.40"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2414dbb2dd0695280da6ea9261e327479e9d37b0630f6b53ba2a11c60c679fd9"
|
||||
checksum = "e0c66c08ce9f0c698cbce5c0279d0bb6ac936d8674174fe48f736533b964f59e"
|
||||
dependencies = [
|
||||
"anstream",
|
||||
"anstyle",
|
||||
@ -766,9 +766,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "clap_derive"
|
||||
version = "4.5.32"
|
||||
version = "4.5.40"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "09176aae279615badda0765c0c0b3f6ed53f4709118af73cf4655d85d1530cd7"
|
||||
checksum = "d2c7947ae4cc3d851207c1adb5b5e260ff0cca11446b1d6d1423788e442257ce"
|
||||
dependencies = [
|
||||
"heck",
|
||||
"proc-macro2",
|
||||
@ -1056,9 +1056,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "diesel"
|
||||
version = "2.2.9"
|
||||
version = "2.2.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "34d3950690ba3a6910126162b47e775e203006d4242a15de912bec6c0a695153"
|
||||
checksum = "a917a9209950404d5be011c81d081a2692a822f73c3d6af586f0cab5ff50f614"
|
||||
dependencies = [
|
||||
"bitflags 2.9.0",
|
||||
"byteorder",
|
||||
@ -1215,9 +1215,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "env_logger"
|
||||
version = "0.11.7"
|
||||
version = "0.11.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c3716d7a920fb4fac5d84e9d4bce8ceb321e9414b4409da61b07b75c1e3d0697"
|
||||
checksum = "13c863f0904021b108aa8b2f55046443e6b1ebde8fd4a15c399893aae4fa069f"
|
||||
dependencies = [
|
||||
"anstream",
|
||||
"anstyle",
|
||||
@ -1443,7 +1443,7 @@ dependencies = [
|
||||
"log",
|
||||
"mailchecker",
|
||||
"mime_guess",
|
||||
"rand 0.9.0",
|
||||
"rand 0.9.1",
|
||||
"redis",
|
||||
"rust-s3",
|
||||
"rust_iso3166",
|
||||
@ -2196,9 +2196,9 @@ checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8"
|
||||
|
||||
[[package]]
|
||||
name = "lettre"
|
||||
version = "0.11.15"
|
||||
version = "0.11.17"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "759bc2b8eabb6a30b235d6f716f7f36479f4b38cbe65b8747aefee51f89e8437"
|
||||
checksum = "cb2a0354e9ece2fcdcf9fa53417f6de587230c0c248068eb058fa26c4a753179"
|
||||
dependencies = [
|
||||
"base64",
|
||||
"chumsky",
|
||||
@ -2904,13 +2904,12 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rand"
|
||||
version = "0.9.0"
|
||||
version = "0.9.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94"
|
||||
checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97"
|
||||
dependencies = [
|
||||
"rand_chacha 0.9.0",
|
||||
"rand_core 0.9.3",
|
||||
"zerocopy 0.8.24",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -3023,9 +3022,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "redis"
|
||||
version = "0.29.2"
|
||||
version = "0.29.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b110459d6e323b7cda23980c46c77157601199c9da6241552b284cd565a7a133"
|
||||
checksum = "1bc42f3a12fd4408ce64d8efef67048a924e543bd35c6591c0447fda9054695f"
|
||||
dependencies = [
|
||||
"arc-swap",
|
||||
"combine",
|
||||
@ -3468,9 +3467,9 @@ checksum = "bbfa15b3dddfee50a0fff136974b3e1bde555604ba463834a7eb7deb6417705d"
|
||||
|
||||
[[package]]
|
||||
name = "sha2"
|
||||
version = "0.10.8"
|
||||
version = "0.10.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8"
|
||||
checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"cpufeatures",
|
||||
|
@ -7,31 +7,31 @@ edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
log = "0.4.27"
|
||||
env_logger = "0.11.7"
|
||||
clap = { version = "4.5.35", features = ["derive", "env"] }
|
||||
env_logger = "0.11.8"
|
||||
clap = { version = "4.5.40", features = ["derive", "env"] }
|
||||
lazy_static = "1.5.0"
|
||||
lazy-regex = "3.4.1"
|
||||
anyhow = "1.0.97"
|
||||
anyhow = "1.0.98"
|
||||
actix-web = "4.10.2"
|
||||
actix-cors = "0.7.1"
|
||||
actix-multipart = "0.7.2"
|
||||
actix-remote-ip = "0.1.0"
|
||||
futures-util = "0.3.30"
|
||||
diesel = { version = "2.2.9", features = ["postgres"] }
|
||||
futures-util = "0.3.31"
|
||||
diesel = { version = "2.2.11", features = ["postgres"] }
|
||||
diesel_migrations = "2.2.0"
|
||||
serde = { version = "1.0.219", features = ["derive"] }
|
||||
serde_json = "1.0.140"
|
||||
mailchecker = "6.0.17"
|
||||
redis = "0.29.2"
|
||||
lettre = "0.11.15"
|
||||
rand = "0.9.0"
|
||||
redis = "0.29.5"
|
||||
lettre = "0.11.17"
|
||||
rand = "0.9.1"
|
||||
bcrypt = "0.17.0"
|
||||
light-openid = "1.0.4"
|
||||
thiserror = "2.0.12"
|
||||
serde_with = "3.12.0"
|
||||
rust_iso3166 = "0.1.14"
|
||||
rust-s3 = "0.35.1"
|
||||
sha2 = "0.10.8"
|
||||
sha2 = "0.10.9"
|
||||
image = "0.25.6"
|
||||
uuid = { version = "1.16.0", features = ["v4"] }
|
||||
httpdate = "1.0.3"
|
||||
@ -40,4 +40,4 @@ mime_guess = "2.0.5"
|
||||
tempfile = "3.19.1"
|
||||
base64 = "0.22.1"
|
||||
ical = { version = "0.11.0", features = ["generator", "ical", "vcard"] }
|
||||
chrono = "0.4.40"
|
||||
chrono = "0.4.41"
|
||||
|
@ -21,7 +21,7 @@ where
|
||||
if POSTGRES_CONNECTION.with(|i| i.borrow().is_none()) {
|
||||
let database_url = AppConfig::get().db_connection_chain();
|
||||
let conn = PgConnection::establish(&database_url)
|
||||
.unwrap_or_else(|_| panic!("Error connecting to {}", database_url));
|
||||
.unwrap_or_else(|_| panic!("Error connecting to {database_url}"));
|
||||
|
||||
POSTGRES_CONNECTION.with(|i| *i.borrow_mut() = Some(conn))
|
||||
}
|
||||
@ -38,7 +38,7 @@ where
|
||||
POSTGRES_CONNECTION.with(|i| *i.borrow_mut() = None)
|
||||
}
|
||||
|
||||
log::error!("Database query error! {:?}", e);
|
||||
log::error!("Database query error! {e:?}");
|
||||
Err(e.into())
|
||||
}
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ pub async fn create_bucket_if_required() -> anyhow::Result<()> {
|
||||
log::warn!("The bucket does not seem to exists, trying to create it!")
|
||||
}
|
||||
Err(e) => {
|
||||
log::error!("Got unexpected error when querying bucket info: {}", e);
|
||||
log::error!("Got unexpected error when querying bucket info: {e}");
|
||||
return Err(BucketServiceError::FailedFetchBucketInfo.into());
|
||||
}
|
||||
}
|
||||
|
@ -79,10 +79,7 @@ pub async fn request_reset_password(
|
||||
match users_service::get_by_mail(&req.mail).await {
|
||||
Ok(mut user) => users_service::request_reset_password(&mut user).await?,
|
||||
Err(e) => {
|
||||
log::error!(
|
||||
"Could not locate user account {}! (error silently ignored)",
|
||||
e
|
||||
);
|
||||
log::error!("Could not locate user account {e}! (error silently ignored)");
|
||||
}
|
||||
}
|
||||
|
||||
@ -122,7 +119,7 @@ pub async fn check_reset_password_token(
|
||||
RatedAction::CheckResetPasswordTokenFailed,
|
||||
)
|
||||
.await?;
|
||||
log::error!("Password reset token could not be used: {}", e);
|
||||
log::error!("Password reset token could not be used: {e}");
|
||||
return Ok(HttpResponse::NotFound().finish());
|
||||
}
|
||||
};
|
||||
@ -156,7 +153,7 @@ pub async fn reset_password(remote_ip: RemoteIP, req: web::Json<ResetPasswordBod
|
||||
RatedAction::CheckResetPasswordTokenFailed,
|
||||
)
|
||||
.await?;
|
||||
log::error!("Password reset token could not be used: {}", e);
|
||||
log::error!("Password reset token could not be used: {e}");
|
||||
return Ok(HttpResponse::NotFound().finish());
|
||||
}
|
||||
};
|
||||
@ -196,7 +193,7 @@ pub async fn password_login(remote_ip: RemoteIP, req: web::Json<PasswordLoginQue
|
||||
let user = match users_service::get_by_mail(&req.mail).await {
|
||||
Ok(u) => u,
|
||||
Err(e) => {
|
||||
log::error!("Auth failed: could not find account by mail! {}", e);
|
||||
log::error!("Auth failed: could not find account by mail! {e}");
|
||||
rate_limiter_service::record_action(remote_ip.0, RatedAction::FailedPasswordLogin)
|
||||
.await?;
|
||||
return Ok(HttpResponse::Unauthorized().json("Invalid credentials"));
|
||||
|
@ -183,9 +183,9 @@ pub async fn import_family(
|
||||
}
|
||||
|
||||
if let Err(e) = req_member_data.to_member(member).await {
|
||||
log::error!("Error while processing import (member {:?}) - {e}", req_id);
|
||||
log::error!("Error while processing import (member {req_id:?}) - {e}");
|
||||
return Ok(
|
||||
HttpResponse::BadRequest().json(format!("Failed to validate member {:?}!", req_id))
|
||||
HttpResponse::BadRequest().json(format!("Failed to validate member {req_id:?}!"))
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@ impl Display for HttpErr {
|
||||
|
||||
impl actix_web::error::ResponseError for HttpErr {
|
||||
fn error_response(&self) -> HttpResponse<BoxBody> {
|
||||
log::error!("Error while processing request! {}", self);
|
||||
log::error!("Error while processing request! {self}");
|
||||
HttpResponse::InternalServerError().body("Failed to execute request!")
|
||||
}
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ impl FromRequest for FamilyAndAccommodationInPath {
|
||||
Self::load_accommodation_from_path(family, accommodation_id)
|
||||
.await
|
||||
.map_err(|e| {
|
||||
log::error!("Failed to extract accommodation ID from URL! {}", e);
|
||||
log::error!("Failed to extract accommodation ID from URL! {e}");
|
||||
actix_web::error::ErrorNotFound("Could not fetch accommodation information!")
|
||||
})
|
||||
})
|
||||
|
@ -85,7 +85,7 @@ impl FromRequest for FamilyAndAccommodationReservationCalendarInPath {
|
||||
Self::load_calendar_from_path(family, accommodation_id)
|
||||
.await
|
||||
.map_err(|e| {
|
||||
log::error!("Failed to extract calendar ID from URL! {}", e);
|
||||
log::error!("Failed to extract calendar ID from URL! {e}");
|
||||
actix_web::error::ErrorNotFound("Could not fetch calendar information!")
|
||||
})
|
||||
})
|
||||
|
@ -95,7 +95,7 @@ impl FromRequest for FamilyAndAccommodationReservationInPath {
|
||||
Self::load_accommodation_reservation_from_path(family, reservation_id)
|
||||
.await
|
||||
.map_err(|e| {
|
||||
log::error!("Failed to extract accommodation ID from URL! {}", e);
|
||||
log::error!("Failed to extract accommodation ID from URL! {e}");
|
||||
actix_web::error::ErrorNotFound("Could not fetch accommodation information!")
|
||||
})
|
||||
})
|
||||
|
@ -71,7 +71,7 @@ impl FromRequest for FamilyAndCoupleInPath {
|
||||
FamilyAndCoupleInPath::load_couple_from_path(family, couple_id)
|
||||
.await
|
||||
.map_err(|e| {
|
||||
log::error!("Failed to extract couple ID from URL! {}", e);
|
||||
log::error!("Failed to extract couple ID from URL! {e}");
|
||||
actix_web::error::ErrorNotFound("Could not fetch couple information!")
|
||||
})
|
||||
})
|
||||
|
@ -62,7 +62,7 @@ impl FromRequest for FamilyInPath {
|
||||
FamilyInPath::load_family_from_path(&token, family_id)
|
||||
.await
|
||||
.map_err(|e| {
|
||||
log::error!("Failed to extract family ID from URL! {}", e);
|
||||
log::error!("Failed to extract family ID from URL! {e}");
|
||||
actix_web::error::ErrorNotFound("Could not fetch family information!")
|
||||
})
|
||||
})
|
||||
|
@ -71,7 +71,7 @@ impl FromRequest for FamilyAndMemberInPath {
|
||||
FamilyAndMemberInPath::load_member_from_path(family, member_id)
|
||||
.await
|
||||
.map_err(|e| {
|
||||
log::error!("Failed to extract member ID from URL! {}", e);
|
||||
log::error!("Failed to extract member ID from URL! {e}");
|
||||
actix_web::error::ErrorNotFound("Could not fetch member information!")
|
||||
})
|
||||
})
|
||||
|
@ -43,7 +43,7 @@ impl User {
|
||||
.as_deref()
|
||||
.map(|hash| {
|
||||
bcrypt::verify(password, hash).unwrap_or_else(|e| {
|
||||
log::error!("Failed to validate password! {}", e);
|
||||
log::error!("Failed to validate password! {e}");
|
||||
false
|
||||
})
|
||||
})
|
||||
|
@ -125,13 +125,13 @@ async fn load_token_info(token: &LoginTokenValue) -> anyhow::Result<Option<Login
|
||||
let token = match user_tokens.iter_mut().find(|t| t.key == key) {
|
||||
Some(t) => t,
|
||||
None => {
|
||||
log::error!("Could not find token for key '{}' (missing token)", key);
|
||||
log::error!("Could not find token for key '{key}' (missing token)");
|
||||
return Ok(None);
|
||||
}
|
||||
};
|
||||
|
||||
if token.is_expired() {
|
||||
log::error!("Could not find token for key '{}' (token expired)", key);
|
||||
log::error!("Could not find token for key '{key}' (token expired)");
|
||||
return Ok(None);
|
||||
}
|
||||
|
||||
@ -169,7 +169,7 @@ impl FromRequest for LoginToken {
|
||||
|
||||
let token = match load_token_info(&token).await {
|
||||
Err(e) => {
|
||||
log::error!("Failed to load auth token! {}", e);
|
||||
log::error!("Failed to load auth token! {e}");
|
||||
return Err(actix_web::error::ErrorPreconditionFailed(
|
||||
"Failed to check auth token!",
|
||||
));
|
||||
|
@ -27,7 +27,7 @@ pub async fn send_mail<D: Display>(to: &str, subject: &str, body: D) -> anyhow::
|
||||
let mailer = mailer.build();
|
||||
|
||||
mailer.send(&email)?;
|
||||
log::debug!("A mail was sent to {} (subject = {})", to, subject);
|
||||
log::debug!("A mail was sent to {to} (subject = {subject})");
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
@ -168,7 +168,7 @@ pub mod loop_detection {
|
||||
None => false,
|
||||
Some(id) => {
|
||||
if curr_stack.contains(id) {
|
||||
log::debug!("Loop detected! {:?}", curr_stack);
|
||||
log::debug!("Loop detected! {curr_stack:?}");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,6 @@ use crate::utils::string_utils::rand_str;
|
||||
use crate::utils::time_utils::time;
|
||||
use bcrypt::DEFAULT_COST;
|
||||
use diesel::prelude::*;
|
||||
use std::io::ErrorKind;
|
||||
|
||||
/// Get the information of a user, by its id
|
||||
pub async fn get_by_id(id: UserID) -> anyhow::Result<User> {
|
||||
@ -25,8 +24,7 @@ pub async fn get_by_mail(mail: &str) -> anyhow::Result<User> {
|
||||
/// Get the information of a user, by its password reset token
|
||||
pub async fn get_by_pwd_reset_token(token: &str) -> anyhow::Result<User> {
|
||||
if token.is_empty() {
|
||||
return Err(anyhow::Error::from(std::io::Error::new(
|
||||
ErrorKind::Other,
|
||||
return Err(anyhow::Error::from(std::io::Error::other(
|
||||
"Token is empty!",
|
||||
)));
|
||||
}
|
||||
@ -46,8 +44,7 @@ pub async fn get_by_pwd_reset_token(token: &str) -> anyhow::Result<User> {
|
||||
/// Get the information of a user, by its account deletion token
|
||||
pub async fn get_by_account_delete_token(token: &str) -> anyhow::Result<User> {
|
||||
if token.is_empty() {
|
||||
return Err(anyhow::Error::from(std::io::Error::new(
|
||||
ErrorKind::Other,
|
||||
return Err(anyhow::Error::from(std::io::Error::other(
|
||||
"Token is empty!",
|
||||
)));
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ pub fn sha256(bytes: &[u8]) -> String {
|
||||
let mut hasher = Sha256::new();
|
||||
hasher.update(bytes);
|
||||
let h = hasher.finalize();
|
||||
format!("{:x}", h)
|
||||
format!("{h:x}")
|
||||
}
|
||||
|
||||
/// Compute hash of a slice of bytes (sha512)
|
||||
@ -13,5 +13,5 @@ pub fn sha512(bytes: &[u8]) -> String {
|
||||
let mut hasher = Sha512::new();
|
||||
hasher.update(bytes);
|
||||
let h = hasher.finalize();
|
||||
format!("{:x}", h)
|
||||
format!("{h:x}")
|
||||
}
|
||||
|
Reference in New Issue
Block a user