Skip to main content

device_code_login

Function device_code_login 

Source
pub fn device_code_login(sleep: &dyn Fn(Duration)) -> Result<String, GraphError>
Expand description

Run the device-code login: request a code, print instructions, poll until the user authorizes (or it expires). Returns the access token. Requires CLIENT_ID_ENV. sleep is injected so the polling loop is deterministic in tests; production passes std::thread::sleep.