@@ -25,6 +25,7 @@ void credential_clear(struct credential *c)
2525 free (c -> path );
2626 free (c -> username );
2727 free (c -> password );
28+ free (c -> oauth_refresh_token );
2829 string_list_clear (& c -> helpers , 0 );
2930 strvec_clear (& c -> wwwauth_headers );
3031
@@ -246,6 +247,9 @@ int credential_read(struct credential *c, FILE *fp)
246247 c -> password_expiry_utc = parse_timestamp (value , NULL , 10 );
247248 if (c -> password_expiry_utc == 0 || errno == ERANGE )
248249 c -> password_expiry_utc = TIME_MAX ;
250+ } else if (!strcmp (key , "oauth_refresh_token" )) {
251+ free (c -> oauth_refresh_token );
252+ c -> oauth_refresh_token = xstrdup (value );
249253 } else if (!strcmp (key , "url" )) {
250254 credential_from_url (c , value );
251255 } else if (!strcmp (key , "quit" )) {
@@ -281,6 +285,7 @@ void credential_write(const struct credential *c, FILE *fp)
281285 credential_write_item (fp , "path" , c -> path , 0 );
282286 credential_write_item (fp , "username" , c -> username , 0 );
283287 credential_write_item (fp , "password" , c -> password , 0 );
288+ credential_write_item (fp , "oauth_refresh_token" , c -> oauth_refresh_token , 0 );
284289 if (c -> password_expiry_utc != TIME_MAX ) {
285290 char * s = xstrfmt ("%" PRItime , c -> password_expiry_utc );
286291 credential_write_item (fp , "password_expiry_utc" , s , 0 );
@@ -406,6 +411,7 @@ void credential_reject(struct credential *c)
406411
407412 FREE_AND_NULL (c -> username );
408413 FREE_AND_NULL (c -> password );
414+ FREE_AND_NULL (c -> oauth_refresh_token );
409415 c -> password_expiry_utc = TIME_MAX ;
410416 c -> approved = 0 ;
411417}
0 commit comments