mirror of
https://github.com/OMGeeky/yup-oauth2.git
synced 2026-01-22 10:05:21 +01:00
feat(GetToken): Add application_secret method to GetToken trait.
This makes decoupling Authenticator and individual flows easier while allowing for refreshing tokens.
This commit is contained in:
@@ -61,10 +61,8 @@ where
|
||||
})
|
||||
}
|
||||
|
||||
impl<
|
||||
FD: FlowDelegate + 'static + Send + Clone,
|
||||
C: hyper::client::connect::Connect + 'static,
|
||||
> GetToken for InstalledFlow<FD, C>
|
||||
impl<FD: FlowDelegate + 'static + Send + Clone, C: hyper::client::connect::Connect + 'static>
|
||||
GetToken for InstalledFlow<FD, C>
|
||||
{
|
||||
fn token<'b, I, T>(
|
||||
&mut self,
|
||||
@@ -79,6 +77,9 @@ impl<
|
||||
fn api_key(&mut self) -> Option<String> {
|
||||
None
|
||||
}
|
||||
fn application_secret(&self) -> ApplicationSecret {
|
||||
self.appsecret.clone()
|
||||
}
|
||||
}
|
||||
|
||||
pub struct InstalledFlow<FD: FlowDelegate, C: hyper::client::connect::Connect + 'static> {
|
||||
@@ -99,11 +100,8 @@ pub enum InstalledFlowReturnMethod {
|
||||
HTTPRedirect(u16),
|
||||
}
|
||||
|
||||
impl<
|
||||
'c,
|
||||
FD: 'static + FlowDelegate + Clone + Send,
|
||||
C: 'c + hyper::client::connect::Connect,
|
||||
> InstalledFlow<FD, C>
|
||||
impl<'c, FD: 'static + FlowDelegate + Clone + Send, C: 'c + hyper::client::connect::Connect>
|
||||
InstalledFlow<FD, C>
|
||||
{
|
||||
/// Starts a new Installed App auth flow.
|
||||
/// If HTTPRedirect is chosen as method and the server can't be started, the flow falls
|
||||
|
||||
Reference in New Issue
Block a user