Skip to content

Commit 77a02d1

Browse files
committed
Fix connecting to OAuth 1.0a providers - is-connected check was wrongly always returning true
- Problem seems to have been introduced with linting fixes added in 369f070
1 parent 43bd764 commit 77a02d1

File tree

1 file changed

+4
-4
lines changed
  • share-oauth/src/main/resources/META-INF/extras/modules

1 file changed

+4
-4
lines changed

share-oauth/src/main/resources/META-INF/extras/modules/oauth.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,8 @@ if (typeof Extras == "undefined" || !Extras)
206206
isAuthorized: function OAuth_isAuthorized()
207207
{
208208
// TODO check that the token is valid as well as that it just exists?
209-
return this.authData.oauth_token !== null && this.authData.oauth_token !== "" &&
210-
this.authData.oauth_token_secret !== null && this.authData.oauth_token_secret !== "" &&
209+
return this.authData.oauth_token &&
210+
this.authData.oauth_token_secret &&
211211
!this.authData.oauth_callback_confirmed;
212212
},
213213

@@ -774,11 +774,11 @@ if (typeof Extras == "undefined" || !Extras)
774774
data.oauth_timestamp = Math.floor(Date.now()/1000);
775775
}
776776
// Access token, if we have one and another token was not specified
777-
if (typeof data.oauth_token === "undefined" && this.authData !== null && this.authData.oauth_token !== null)
777+
if (typeof data.oauth_token === "undefined" && this.authData && this.authData.oauth_token)
778778
{
779779
data.oauth_token = this.authData.oauth_token;
780780
}
781-
if (typeof data.oauth_token_secret === "undefined" && this.authData !== null && this.authData.oauth_token_secret !== null)
781+
if (typeof data.oauth_token_secret === "undefined" && this.authData && this.authData.oauth_token_secret)
782782
{
783783
data.oauth_token_secret = this.authData.oauth_token_secret;
784784
}

0 commit comments

Comments
 (0)