Skip to main content

poll_for_token

Function poll_for_token 

Source
pub fn poll_for_token(
    host: &Host,
    device_code: &str,
    interval: u64,
    expires_in: u64,
) -> Result<String, GorError>
Expand description

Poll for the access token until the user completes authorization or the flow times out.

Displays a spinner and status messages to stderr while polling.

§Errors

Returns GorError::DeviceTimeout if the user doesn’t authorize within the timeout. Returns GorError::DeviceDeclined if the user declines authorization. Returns GorError::Auth for other errors.