Skip to content

Commit 17d6af8

Browse files
committed
⬆️ 1.0.4 🎉
1 parent 6120420 commit 17d6af8

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

lib/index.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,20 @@ exports.init = function (config, bloggify) {
4949
});
5050

5151
this.ghClient = ghClient;
52+
this.ghApiClient = null;
5253

5354
ghClient.on("error", (err, res) => {
54-
this.emit("login-error", err, res.lien, ghApiClient);
55+
this.emit("login-error", err, res.lien, this.ghClient, this.ghApiClient);
5556
});
5657

5758
ghClient.on("token", (token, res) => {
5859
if (token.error) {
5960
return ghClient.emit("error", token, res);
6061
}
6162

62-
this.emit("token", token, res.lien, ghApiClient);
63-
let ghApiClient = new GitHub(token.access_token);
63+
let ghApiClient = this.ghApiClient = new GitHub(token.access_token);
64+
this.emit("token", token, res.lien, this.ghClient, this.ghApiClient);
65+
6466
ghApiClient.get("user", (err, user) => {
6567

6668
if (err) {
@@ -75,7 +77,7 @@ exports.init = function (config, bloggify) {
7577

7678
user.emails = emails;
7779

78-
this.emit("login-success", token, user, res.lien, ghApiClient);
80+
this.emit("login-success", token, user, res.lien, ghApiClient, this.ghClient);
7981
});
8082
});
8183
});

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"for"
1010
],
1111
"license": "MIT",
12-
"version": "1.0.3",
12+
"version": "1.0.4",
1313
"main": "lib/index.js",
1414
"scripts": {
1515
"test": "echo \"Error: no test specified\" && exit 1"

0 commit comments

Comments
 (0)