Repository: Wulf/create-rust-app (language: rust)

Issue:
[Bug] client device never set in Auth::controller::login()
https://github.com/Wulf/create-rust-app/blob/5008413e29aeeaf3efb7df80f18cce0b5e6e6d55/create-rust-app/src/auth/controller.rs#L188-L195

device is never set, so will always be stored as Null

PR with a fix is coming soon
[Bug] client device never set in Auth::controller::login()
https://github.com/Wulf/create-rust-app/blob/5008413e29aeeaf3efb7df80f18cce0b5e6e6d55/create-rust-app/src/auth/controller.rs#L188-L195

device is never set, so will always be stored as Null

PR with a fix is coming soon


Discussion / hints:

Fix patch:
diff --git a/create-rust-app/src/auth/controller.rs b/create-rust-app/src/auth/controller.rs
index c8121c19..cdc2c9ba 100644
--- a/create-rust-app/src/auth/controller.rs
+++ b/create-rust-app/src/auth/controller.rs
@@ -192,6 +192,9 @@ pub fn login(
         if device_string.len() > 256 {
             return Err((400, "'device' cannot be longer than 256 characters."));
         }
+        else {
+            device = Some(device_string.to_owned());
+        }
     }
 
     let user = User::find_by_email(&mut db, item.email.clone());
@@ -693,4 +696,4 @@ pub fn generate_salt() -> [u8; 16] {
     let mut salt = [0; 16];
     salt.try_fill(&mut rand::thread_rng()).unwrap();
     salt
-}
\ No newline at end of file
+}


Test patch: