summaryrefslogtreecommitdiff
path: root/plugins/authenticator/shotwell
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2019-08-16 07:14:05 +0200
committerJörg Frings-Fürst <debian@jff.email>2019-08-16 07:14:05 +0200
commit10ce63378912ef63c8882889f02ed4dff0416f32 (patch)
tree7cc5bafae0364fa659af2013b2a36bd1baf336af /plugins/authenticator/shotwell
parentf83e6f04c2e430326656513ce02c4206aac8cc07 (diff)
parentde21437207c39bdacacc74896c0d1c820c314d22 (diff)
Merge branch 'release/debian/0.30.5-1'debian/0.30.5-1
Diffstat (limited to 'plugins/authenticator/shotwell')
-rw-r--r--plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala14
-rw-r--r--plugins/authenticator/shotwell/GoogleAuthenticator.vala11
2 files changed, 24 insertions, 1 deletions
diff --git a/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala b/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala
index 5188ed6..ea4d9ce 100644
--- a/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala
+++ b/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala
@@ -54,6 +54,12 @@ namespace Publishing.Authenticator.Shotwell.Flickr {
}
public override void on_page_load() {
+ if (this.load_error != null) {
+ this.error();
+
+ return;
+ }
+
var uri = new Soup.URI(get_view().get_uri());
if (uri.scheme == "shotwell-auth" && this.auth_code == null) {
var form_data = Soup.Form.decode (uri.query);
@@ -77,6 +83,8 @@ namespace Publishing.Authenticator.Shotwell.Flickr {
}
internal class Flickr : Publishing.Authenticator.Shotwell.OAuth1.Authenticator {
+ private WebAuthenticationPane pane;
+
public Flickr(Spit.Publishing.PluginHost host) {
base(API_KEY, API_SECRET, host);
}
@@ -185,13 +193,17 @@ namespace Publishing.Authenticator.Shotwell.Flickr {
}
private void do_web_authentication(string token) {
- var pane = new WebAuthenticationPane(token);
+ pane = new WebAuthenticationPane(token);
host.install_dialog_pane(pane);
pane.authorized.connect(this.do_verify_pin);
pane.error.connect(this.on_web_login_error);
}
private void on_web_login_error() {
+ if (pane.load_error != null) {
+ host.post_error(pane.load_error);
+ return;
+ }
host.post_error(new Spit.Publishing.PublishingError.PROTOCOL_ERROR(_("Flickr authorization failed")));
}
diff --git a/plugins/authenticator/shotwell/GoogleAuthenticator.vala b/plugins/authenticator/shotwell/GoogleAuthenticator.vala
index 75d8f37..5b38ee6 100644
--- a/plugins/authenticator/shotwell/GoogleAuthenticator.vala
+++ b/plugins/authenticator/shotwell/GoogleAuthenticator.vala
@@ -21,6 +21,12 @@ namespace Publishing.Authenticator.Shotwell.Google {
}
public override void on_page_load() {
+ if (this.load_error != null) {
+ this.error ();
+
+ return;
+ }
+
var uri = new Soup.URI(get_view().get_uri());
if (uri.scheme == REVERSE_CLIENT_ID && this.auth_code == null) {
var form_data = Soup.Form.decode (uri.query);
@@ -173,6 +179,7 @@ namespace Publishing.Authenticator.Shotwell.Google {
web_auth_pane = new WebAuthenticationPane(user_authorization_url);
web_auth_pane.authorized.connect(on_web_auth_pane_authorized);
+ web_auth_pane.error.connect(on_web_auth_pane_error);
host.install_dialog_pane(web_auth_pane);
}
@@ -185,6 +192,10 @@ namespace Publishing.Authenticator.Shotwell.Google {
do_get_access_tokens(auth_code);
}
+ private void on_web_auth_pane_error() {
+ host.post_error(web_auth_pane.load_error);
+ }
+
private void do_get_access_tokens(string auth_code) {
debug("ACTION: exchanging authorization code for access & refresh tokens");