Skip to content

Commit

Permalink
Only use the refresh token to login if we've allowed saving the password
Browse files Browse the repository at this point in the history
Fixes issue #481
  • Loading branch information
EionRobb committed Oct 15, 2016
1 parent 2e1ac47 commit a000b9e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion skypeweb/libskypeweb.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ skypeweb_login(PurpleAccount *account)
sa->messages_host = g_strdup(SKYPEWEB_DEFAULT_MESSAGES_HOST);
sa->url_datas = NULL;

if (purple_account_get_string(account, "refresh-token", NULL)) {
if (purple_account_get_string(account, "refresh-token", NULL) && purple_account_get_remember_password(account)) {
skypeweb_refresh_token_login(sa);
} else {
skypeweb_begin_oauth_login(sa);
Expand Down
4 changes: 3 additions & 1 deletion skypeweb/skypeweb_login.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ skypeweb_login_did_auth(PurpleUtilFetchUrlData *url_data, gpointer user_data, co
sa->skype_token = refresh_token;

skypeweb_update_cookies(sa, url_text);
purple_account_set_string(sa->account, "refresh-token", g_hash_table_lookup(sa->cookie_table, "refresh-token"));
if (purple_account_get_remember_password(sa->account)) {
purple_account_set_string(sa->account, "refresh-token", g_hash_table_lookup(sa->cookie_table, "refresh-token"));
}

skypeweb_do_all_the_things(sa);
}
Expand Down

0 comments on commit a000b9e

Please sign in to comment.