From 2b6e7d14cd97153d83d8975f177c5c41fc6f4650 Mon Sep 17 00:00:00 2001 From: Robin Date: Tue, 14 Apr 2015 17:26:02 +0200 Subject: [PATCH] BUG-1769: Fix for credentials & when the denied is selected when the authorize is shown in the browser. --- GreenshotPicasaPlugin/PicasaCredentials.cs | 4 ++-- GreenshotPicasaPlugin/PicasaUtils.cs | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/GreenshotPicasaPlugin/PicasaCredentials.cs b/GreenshotPicasaPlugin/PicasaCredentials.cs index 046d188f9..83c6059b6 100644 --- a/GreenshotPicasaPlugin/PicasaCredentials.cs +++ b/GreenshotPicasaPlugin/PicasaCredentials.cs @@ -25,7 +25,7 @@ namespace GreenshotPicasaPlugin { /// You can set your own values here /// public static class PicasaCredentials { - public static string ConsumerKey = "@credentials_picasa_consumer_key@"; - public static string ConsumerSecret = "@credentials_picasa_consumer_secret@"; + public static string ClientId = "@credentials_picasa_consumer_key@"; + public static string ClientSecret = "@credentials_picasa_consumer_secret@"; } } diff --git a/GreenshotPicasaPlugin/PicasaUtils.cs b/GreenshotPicasaPlugin/PicasaUtils.cs index c8c7c296e..6faea9ac6 100644 --- a/GreenshotPicasaPlugin/PicasaUtils.cs +++ b/GreenshotPicasaPlugin/PicasaUtils.cs @@ -51,6 +51,14 @@ namespace GreenshotPicasaPlugin { if (result.TryGetValue("code", out code)) { GenerateToken(code, settings); } + string error; + if (result.TryGetValue("error", out error)) { + if ("access_denied" == error) { + throw new UnauthorizedAccessException("Access denied"); + } else { + throw new Exception(error); + } + } } ///