sanko / robinhood_rs

Rust wrapper for Robinhood, the commission-free brokerage
Artistic License 2.0
12 stars 4 forks source link

Issues getting back a token - thread 'main' panicked at 'called `Option::unwrap()` on a `None` value' #2

Closed caviles closed 4 years ago

caviles commented 4 years ago

Hi,

First off thanks for creating this crate. I'm excited to start using it.

My env vars are set for my creds correctly and when I step through the code I can see they're being unwrapped however when trying to initiate the client I get the following error. I've confirmed MFA is disabled.

let rh = Client::new().login(username, password).build().unwrap(); lib.rs\build(&mut self) -> Result { .. headers.set(Authorization( String::from("Token ") + token.unwrap().token.to_owned().unwrap().as_ref(), ));

} The line above throws this error -> thread 'main' panicked at 'called Option::unwrap() on a None value'

TIA