[shotwell/wip/pluggable-auth: 19/20] wip: google: Persistency handling in authenticator
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [shotwell/wip/pluggable-auth: 19/20] wip: google: Persistency handling in authenticator
- Date: Thu, 9 Feb 2017 22:06:13 +0000 (UTC)
commit a73caf0a0dfb0fd9cd193633706a6787fe120267
Author: Jens Georg <mail jensge org>
Date: Thu Feb 9 22:38:42 2017 +0100
wip: google: Persistency handling in authenticator
Signed-off-by: Jens Georg <mail jensge org>
.../shotwell/GoogleAuthenticator.vala | 4 +++-
plugins/common/RESTSupport.vala | 6 ------
plugins/shotwell-publishing/PicasaPublishing.vala | 1 -
plugins/shotwell-publishing/YouTubePublishing.vala | 2 --
4 files changed, 3 insertions(+), 10 deletions(-)
---
diff --git a/plugins/authenticator/shotwell/GoogleAuthenticator.vala
b/plugins/authenticator/shotwell/GoogleAuthenticator.vala
index c263200..f203139 100644
--- a/plugins/authenticator/shotwell/GoogleAuthenticator.vala
+++ b/plugins/authenticator/shotwell/GoogleAuthenticator.vala
@@ -96,8 +96,9 @@ namespace Publishing.Authenticator.Shotwell.Google {
public void authenticate() {
var refresh_token = host.get_config_string("refresh_token", null);
if (refresh_token != null && refresh_token != "") {
- session.refresh_token = refresh_token;
+ on_refresh_token_available(refresh_token);
do_exchange_refresh_token_for_access_token();
+ return;
}
// FIXME: Find a way for a proper logout
@@ -305,6 +306,7 @@ namespace Publishing.Authenticator.Shotwell.Google {
// by the time we get a username, the session should be authenticated, or else something
// really tragic has happened
assert(session.is_authenticated());
+ host.set_config_string("refresh_token", session.refresh_token);
this.authenticated();
}
diff --git a/plugins/common/RESTSupport.vala b/plugins/common/RESTSupport.vala
index ceee967..24b3f76 100644
--- a/plugins/common/RESTSupport.vala
+++ b/plugins/common/RESTSupport.vala
@@ -746,7 +746,6 @@ public string asciify_string(string s) {
public abstract class GoogleSession : Session {
public abstract string get_user_name();
public abstract string get_access_token();
- public abstract string get_refresh_token();
public abstract void deauthenticate();
}
@@ -779,11 +778,6 @@ public abstract class GooglePublisher : Object, Spit.Publishing.Publisher {
return access_token;
}
- public override string get_refresh_token() {
- assert(refresh_token != null);
- return refresh_token;
- }
-
public override void deauthenticate() {
access_token = null;
user_name = null;
diff --git a/plugins/shotwell-publishing/PicasaPublishing.vala
b/plugins/shotwell-publishing/PicasaPublishing.vala
index cff9beb..7f3ce7d 100644
--- a/plugins/shotwell-publishing/PicasaPublishing.vala
+++ b/plugins/shotwell-publishing/PicasaPublishing.vala
@@ -144,7 +144,6 @@ public class PicasaPublisher : Publishing.RESTSupport.GooglePublisher {
protected override void on_login_flow_complete() {
debug("EVENT: OAuth login flow complete.");
- get_host().set_config_string("refresh_token", get_session().get_refresh_token());
publishing_parameters.set_user_name(get_session().get_user_name());
diff --git a/plugins/shotwell-publishing/YouTubePublishing.vala
b/plugins/shotwell-publishing/YouTubePublishing.vala
index ee7c158..7d1243f 100644
--- a/plugins/shotwell-publishing/YouTubePublishing.vala
+++ b/plugins/shotwell-publishing/YouTubePublishing.vala
@@ -213,8 +213,6 @@ public class YouTubePublisher : Publishing.RESTSupport.GooglePublisher {
protected override void on_login_flow_complete() {
debug("EVENT: OAuth login flow complete.");
- get_host().set_config_string("refresh_token", get_session().get_refresh_token());
-
publishing_parameters.set_user_name(get_session().get_user_name());
do_fetch_account_information();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]