Skip to content

Commit

Permalink
fix: bug in login preventing totp from being saved.
Browse files Browse the repository at this point in the history
  • Loading branch information
ccrutchf committed Dec 14, 2024
1 parent e7af664 commit 411f3e4
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/synology_api/file_station.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,15 +379,21 @@ impl SynologyFileStation {
);

let mut login_url = format!(
"{}/webapi/entry.cgi?api=SYNO.API.Auth&version={}&method=login&account={}&passwd={}&enable_device_token={}&device_name={}&session=FileStation&fromat=sid",
"{}/webapi/entry.cgi?api=SYNO.API.Auth&version={}&method=login&account={}&passwd={}&device_name={}&session=FileStation&fromat=sid",
self.url,
6,
encode(credential.user.as_str()),
encode(credential.password.as_str()), // Encode the password in case it has characters not allowed in URLs in it.
if enable_device_token { "yes "} else { "no" },
device_name
encode(&credential.user),
encode(&credential.password), // Encode the password in case it has characters not allowed in URLs in it.
encode(&device_name)
);

if enable_device_token {
login_url = format!(
"{}&enable_device_token=yes",
login_url
)
}

if let Some(did) = credential.device_id.clone() {
info!("Credential has device ID");

Expand Down

0 comments on commit 411f3e4

Please sign in to comment.