summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2021-09-29 00:05:12 +0200
committerSanto Cariotti <santo@dcariotti.me>2021-09-29 00:05:12 +0200
commit8de625e9eba926c7ca8c2f86d658283480938b2f (patch)
treeb0de52c2f28a43ef2399bf5017e4c4bdf5776adb
parentee5a471b972494098edd41687821d672e99c9976 (diff)
fix: `LOGIN_URL` for using `.starts_with()`
-rw-r--r--src/browser/web_browser.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/browser/web_browser.rs b/src/browser/web_browser.rs
index 8ba21d6..59b2dff 100644
--- a/src/browser/web_browser.rs
+++ b/src/browser/web_browser.rs
@@ -7,7 +7,7 @@ use thirtyfour::prelude::{By, WebDriverResult};
use thirtyfour::{FirefoxCapabilities, WebDriver, WebDriverCommands, WebElement};
/// This url is used to make the login
-const LOGIN_URL: &str = "https://studenti.smartedu.unict.it/WorkFlow2011/Logon/Logon.aspx?ReturnUrl=%2fStudenti%2fDefault.aspx";
+const LOGIN_URL: &str = "https://studenti.smartedu.unict.it/WorkFlow2011/Logon/Logon.aspx";
/// This url is used to go to the page where a student can book a room for study
pub const ROOMS_URL: &str = "https://studenti.smartedu.unict.it/StudentSpaceReserv?Type=unaTantum";
@@ -66,7 +66,7 @@ impl Browser {
// If the current url is the same as `LOGIN_URL` it means the login didn't work, so
// returns a "login error"
- if _d.current_url().await? == LOGIN_URL {
+ if _d.current_url().await?.starts_with(LOGIN_URL) {
return Err(WebDriverError::SessionNotCreated(WebDriverErrorInfo {
status: 400,
error: "SessionNotCreated".to_string(),