3 Commits

Author SHA1 Message Date
6cf6ab5a37 Update dependency @emotion/styled to ^11.14.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-07-04 00:09:24 +00:00
1781318fdf Fix bad backend URL on generated Qr Code for tokens authentication
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2025-07-03 22:00:20 +02:00
2560962684 Fix cargo clippy issues
All checks were successful
continuous-integration/drone/push Build is passing
2025-07-03 08:38:56 +02:00
10 changed files with 23 additions and 14 deletions

View File

@ -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!") log::warn!("The bucket does not seem to exists, trying to create it!")
} }
Err(e) => { 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()); return Err(BucketServiceError::FailedFetchBucketInfo.into());
} }
} }

View File

@ -50,7 +50,7 @@ impl FromRequest for AccountInPath {
Self::load_account_from_path(&auth, account_id) Self::load_account_from_path(&auth, account_id)
.await .await
.map_err(|e| { .map_err(|e| {
log::error!("Failed to extract account ID from URL! {}", e); log::error!("Failed to extract account ID from URL! {e}");
actix_web::error::ErrorNotFound("Could not fetch account information!") actix_web::error::ErrorNotFound("Could not fetch account information!")
}) })
}) })

View File

@ -165,13 +165,13 @@ impl FromRequest for AuthExtractor {
// Update last use (if needed) // Update last use (if needed)
if token.shall_update_time_used() { if token.shall_update_time_used() {
if let Err(e) = tokens_service::update_time_used(&token).await { if let Err(e) = tokens_service::update_time_used(&token).await {
log::error!("Failed to refresh last usage of token! {}", e); log::error!("Failed to refresh last usage of token! {e}");
} }
} }
// Handle tokens expiration // Handle tokens expiration
if token.is_expired() { if token.is_expired() {
log::error!("Attempted to use expired token! {:?}", token); log::error!("Attempted to use expired token! {token:?}");
return Err(actix_web::error::ErrorBadRequest("Token has expired!")); return Err(actix_web::error::ErrorBadRequest("Token has expired!"));
} }

View File

@ -47,7 +47,7 @@ impl FromRequest for FileIdExtractor {
Self::load_file_from_path(&auth, file_id) Self::load_file_from_path(&auth, file_id)
.await .await
.map_err(|e| { .map_err(|e| {
log::error!("Failed to extract file ID from URL! {}", e); log::error!("Failed to extract file ID from URL! {e}");
actix_web::error::ErrorNotFound("Could not fetch file information!") actix_web::error::ErrorNotFound("Could not fetch file information!")
}) })
}) })

View File

@ -50,7 +50,7 @@ impl FromRequest for InboxEntryInPath {
Self::load_inbox_entry_from_path(&auth, entry_id) Self::load_inbox_entry_from_path(&auth, entry_id)
.await .await
.map_err(|e| { .map_err(|e| {
log::error!("Failed to extract inbox entry ID from URL! {}", e); log::error!("Failed to extract inbox entry ID from URL! {e}");
actix_web::error::ErrorNotFound("Could not fetch inbox entry information!") actix_web::error::ErrorNotFound("Could not fetch inbox entry information!")
}) })
}) })

View File

@ -57,7 +57,7 @@ impl FromRequest for MovementInPath {
Self::load_movement_from_path(&auth, account_id) Self::load_movement_from_path(&auth, account_id)
.await .await
.map_err(|e| { .map_err(|e| {
log::error!("Failed to extract movement ID from URL! {}", e); log::error!("Failed to extract movement ID from URL! {e}");
actix_web::error::ErrorNotFound("Could not fetch movement information!") actix_web::error::ErrorNotFound("Could not fetch movement information!")
}) })
}) })

View File

@ -9,7 +9,7 @@
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"@emotion/react": "^11.14.0", "@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.0", "@emotion/styled": "^11.14.1",
"@fontsource/roboto": "^5.2.6", "@fontsource/roboto": "^5.2.6",
"@jsonjoy.com/base64": "^1.1.2", "@jsonjoy.com/base64": "^1.1.2",
"@mdi/js": "^7.4.47", "@mdi/js": "^7.4.47",
@ -444,9 +444,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/@emotion/styled": { "node_modules/@emotion/styled": {
"version": "11.14.0", "version": "11.14.1",
"resolved": "https://registry.npmjs.org/@emotion/styled/-/styled-11.14.0.tgz", "resolved": "https://registry.npmjs.org/@emotion/styled/-/styled-11.14.1.tgz",
"integrity": "sha512-XxfOnXFffatap2IyCeJyNov3kiDQWoR08gPUQxvbL7fxKryGBKUZUkG6Hz48DZwVrJSVh9sJboyV1Ds4OW6SgA==", "integrity": "sha512-qEEJt42DuToa3gurlH4Qqc1kVpNq8wO8cJtDzU46TjlzWjDlsVyevtYCRijVq3SrHsROS+gVQ8Fnea108GnKzw==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.18.3", "@babel/runtime": "^7.18.3",

View File

@ -11,7 +11,7 @@
}, },
"dependencies": { "dependencies": {
"@emotion/react": "^11.14.0", "@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.0", "@emotion/styled": "^11.14.1",
"@fontsource/roboto": "^5.2.6", "@fontsource/roboto": "^5.2.6",
"@jsonjoy.com/base64": "^1.1.2", "@jsonjoy.com/base64": "^1.1.2",
"@mdi/js": "^7.4.47", "@mdi/js": "^7.4.47",

View File

@ -31,12 +31,21 @@ export class APIClient {
return URL; return URL;
} }
/**
* Get the full URL at which the backend can be contacted
*/
static ActualBackendURL(): string {
const backendURL = this.backendURL();
if (backendURL.startsWith("/")) return `${location.origin}${backendURL}`;
else return backendURL;
}
/** /**
* Check out whether the backend is accessed through * Check out whether the backend is accessed through
* HTTPS or not * HTTPS or not
*/ */
static IsBackendSecure(): boolean { static IsBackendSecure(): boolean {
return this.backendURL().startsWith("https"); return this.ActualBackendURL().startsWith("https");
} }
/** /**

View File

@ -268,7 +268,7 @@ function CreatedToken(p: { token: TokenWithSecret }): React.ReactElement {
<div style={{ padding: "15px", backgroundColor: "white" }}> <div style={{ padding: "15px", backgroundColor: "white" }}>
<QRCodeCanvas <QRCodeCanvas
value={`moneymgr://api=${encodeURIComponent( value={`moneymgr://api=${encodeURIComponent(
APIClient.backendURL() APIClient.ActualBackendURL()
)}&id=${p.token.id}&secret=${p.token.token}`} )}&id=${p.token.id}&secret=${p.token.token}`}
/> />
</div> </div>