Skip to content

Commit a26e4c7

Browse files
RiverAgeflovilmart
authored andcommitted
fix: proper error message when login with wechat fails (#4000)
* fix typo it should be weixin not qq. * change error message from weixin to wechat * remove unnecessary check
1 parent 9d6b4f4 commit a26e4c7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Adapters/Auth/vkontakte.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ var logger = require('../../logger').default;
99
// Returns a promise that fulfills iff this user id is valid.
1010
function validateAuthData(authData, params) {
1111
return vkOAuth2Request(params).then(function (response) {
12-
if (response && response && response.access_token) {
12+
if (response && response.access_token) {
1313
return request("api.vk.com", "method/secure.checkToken?token=" + authData.access_token + "&client_secret=" + params.appSecret + "&access_token=" + response.access_token).then(function (response) {
1414
if (response && response.response && response.response.user_id == authData.id) {
1515
return;

src/Adapters/Auth/wechat.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function validateAuthData(authData) {
88
if (data.errcode == 0) {
99
return;
1010
}
11-
throw new Parse.Error(Parse.Error.OBJECT_NOT_FOUND, 'qq auth is invalid for this user.');
11+
throw new Parse.Error(Parse.Error.OBJECT_NOT_FOUND, 'wechat auth is invalid for this user.');
1212
});
1313
}
1414

@@ -34,7 +34,7 @@ function graphRequest(path) {
3434
resolve(data);
3535
});
3636
}).on('error', function () {
37-
reject('Failed to validate this access token with weixin.');
37+
reject('Failed to validate this access token with wechat.');
3838
});
3939
});
4040
}

0 commit comments

Comments
 (0)