@@ -100,6 +100,9 @@ pub struct OAuth {
100
100
pub access_token : SecretString ,
101
101
pub token_type : String ,
102
102
pub scope : Vec < String > ,
103
+ pub expires_in : Option < usize > ,
104
+ pub refresh_token : Option < SecretString > ,
105
+ pub refresh_token_expires_in : Option < usize > ,
103
106
}
104
107
105
108
/// The wire format of the OAuth struct.
@@ -108,6 +111,9 @@ struct OAuthWire {
108
111
access_token : String ,
109
112
token_type : String ,
110
113
scope : String ,
114
+ expires_in : Option < usize > ,
115
+ refresh_token : Option < String > ,
116
+ refresh_token_expires_in : Option < usize > ,
111
117
}
112
118
113
119
impl From < OAuthWire > for OAuth {
@@ -116,6 +122,9 @@ impl From<OAuthWire> for OAuth {
116
122
access_token : SecretString :: from ( value. access_token ) ,
117
123
token_type : value. token_type ,
118
124
scope : value. scope . split ( ',' ) . map ( ToString :: to_string) . collect ( ) ,
125
+ expires_in : value. expires_in ,
126
+ refresh_token : value. refresh_token . map ( |t| SecretString :: from ( t) ) ,
127
+ refresh_token_expires_in : value. refresh_token_expires_in ,
119
128
}
120
129
}
121
130
}
0 commit comments