Improve clarity on redirect URLs for #191

This commit is contained in:
Lewin Bormann
2023-02-10 20:59:01 +01:00
parent 1c6f9a7d56
commit 0a7e695971
2 changed files with 17 additions and 0 deletions

View File

@@ -156,3 +156,11 @@ impl DeviceFlowDelegate for DefaultDeviceFlowDelegate {}
#[derive(Copy, Clone)]
pub struct DefaultInstalledFlowDelegate;
impl InstalledFlowDelegate for DefaultInstalledFlowDelegate {}
/// The default installed-flow delegate (i.e.: show URL on stdout). Use this to specify
/// a custom redirect URL.
#[derive(Clone)]
pub struct DefaultInstalledFlowDelegateWithRedirectURI(pub String);
impl InstalledFlowDelegate for DefaultInstalledFlowDelegateWithRedirectURI {
fn redirect_uri(&self) -> Option<&str> { Some(self.0.as_str()) }
}