Skip to content

Commit 5e8ec22

Browse files
committed
removed unneeded access token
1 parent 443a16a commit 5e8ec22

File tree

7 files changed

+24
-25
lines changed

7 files changed

+24
-25
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Author: Jonathan Hornung ([JohnnyTheTank](https://github.com/JohnnyTheTank))
3434
```js
3535
githubFactory.getUser({
3636
user:"<USERNAME_NAME>",
37-
access_token:"<ACCESS_TOKEN>"
37+
access_token:"<ACCESS_TOKEN>" // (optional)
3838
}).then(function(_data){
3939
//on success
4040
}).catch(function (_data) {
@@ -47,7 +47,7 @@ githubFactory.getUser({
4747
githubFactory.getRepoByUserAndName({
4848
user:"<USER_NAME>",
4949
repo:"<REPO_NAME>",
50-
access_token:"<ACCESS_TOKEN>"
50+
access_token:"<ACCESS_TOKEN>" // (optional)
5151
}).then(function(_data){
5252
//on success
5353
}).catch(function (_data) {
@@ -63,7 +63,7 @@ githubFactory.getReposByName({
6363
sort:"<SORT_STRING>", // (optional) 'stars', 'forks', or 'updated'
6464
order:"<SORT_ORDER>", // (optional) 'desc', 'asc'
6565
per_page:"<ITEMS_PER_PAGE>", // (optional) valid values: 1-100 | default: 30
66-
access_token:"<ACCESS_TOKEN>"
66+
access_token:"<ACCESS_TOKEN>" // (optional)
6767
}).then(function(_data){
6868
//on success
6969
}).catch(function (_data) {
@@ -78,7 +78,7 @@ githubFactory.getReposByUser({
7878
sort:"<SORT_STRING>", // (optional) 'stars', 'forks', or 'updated'
7979
order:"<SORT_ORDER>", // (optional) 'desc', 'asc'
8080
per_page:"<ITEMS_PER_PAGE>", // (optional) valid values: 1-100 | default: 30
81-
access_token:"<ACCESS_TOKEN>"
81+
access_token:"<ACCESS_TOKEN>" // (optional)
8282
}).then(function(_data){
8383
//on success
8484
}).catch(function (_data) {
@@ -95,7 +95,7 @@ githubFactory.getEventsFromRepoByUserAndName({
9595
sort:"<SORT_STRING>", // (optional)
9696
order:"<SORT_ORDER>", // (optional) 'desc', 'asc'
9797
per_page:"<ITEMS_PER_PAGE>", // (optional) valid values: 1-100 | default: 30
98-
access_token:"<ACCESS_TOKEN>"
98+
access_token:"<ACCESS_TOKEN>" // (optional)
9999
}).then(function(_data){
100100
//on success
101101
}).catch(function (_data) {
@@ -110,7 +110,7 @@ githubFactory.getEventsByUser({
110110
sort:"<SORT_STRING>", // (optional)
111111
order:"<SORT_ORDER>", // (optional) 'desc', 'asc'
112112
per_page:"<ITEMS_PER_PAGE>", // (optional) valid values: 1-100 | default: 30
113-
access_token:"<ACCESS_TOKEN>"
113+
access_token:"<ACCESS_TOKEN>" // (optional)
114114
}).then(function(_data){
115115
//on success
116116
}).catch(function (_data) {

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "angular-github-api-factory",
33
"description": "angularjs factory for github json rest api requests",
4-
"version": "0.5.0",
4+
"version": "0.5.1",
55
"main": "dist/angular-github-api-factory.js",
66
"authors": [
77
"Jonathan Hornung"

demo/js/app.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,32 @@
11
var app = angular.module("app", ['jtt_github']);
22
app.controller('controller', ['$scope', 'githubFactory', function($scope, githubFactory) {
33

4-
var _access_token = '<YOUR_GITHUB_ACCESS_TOKEN>';
5-
64
githubFactory.getUser({
75
user:"xremix",
8-
access_token:_access_token
96
}).then(function(_data){
107
console.info("user", _data);
118
});
129

10+
1311
githubFactory.getReposByUser({
1412
user:"JohnnyTheTank",
1513
per_page: 100,
16-
access_token:_access_token
1714
}).success(function(_data){
1815
console.info("repos by user", _data);
1916
});
2017

18+
2119
githubFactory.getReposByName({
2220
q:"apiNG-plugin",
2321
per_page: 20,
24-
access_token:_access_token
2522
}).then(function(_data){
2623
console.info("repos by name", _data);
2724
});
2825

26+
2927
githubFactory.getEventsByUser({
3028
user:"xremix",
3129
per_page: 20,
32-
access_token:_access_token
3330
}).then(function(_data){
3431
console.info("events by user", _data);
3532
});
@@ -38,7 +35,6 @@ app.controller('controller', ['$scope', 'githubFactory', function($scope, github
3835
user:"JohnnyTheTank",
3936
repo:"apiNG",
4037
per_page: 100,
41-
access_token:_access_token
4238
}).then(function(_data){
4339
console.info("events from repo by user and name", _data);
4440
});
@@ -47,7 +43,6 @@ app.controller('controller', ['$scope', 'githubFactory', function($scope, github
4743
user:"xremix",
4844
repo:"xGallerify",
4945
per_page: 20,
50-
access_token:_access_token
5146
}).then(function(_data){
5247
console.info("repo by user and name", _data);
5348
});

dist/angular-github-api-factory.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
@name: angular-github-api-factory
3-
@version: 0.5.0 (17-02-2016)
3+
@version: 0.5.1 (01-06-2016)
44
@author: Jonathan Hornung
55
@url: https://github.com/JohnnyTheTank/angular-github-api-factory#readme
66
@license: MIT
@@ -86,16 +86,18 @@ angular.module("jtt_github", [])
8686

8787
this.getNew = function (_type, _params) {
8888
var githubSearchData = {
89-
object: {
90-
access_token: _params.access_token,
91-
},
89+
object: {},
9290
url: "",
9391
};
9492

9593
if (angular.isDefined(_params.per_page)) {
9694
githubSearchData.object.per_page = _params.per_page;
9795
}
9896

97+
if (angular.isDefined(_params.access_token)) {
98+
githubSearchData.object.access_token = _params.access_token;
99+
}
100+
99101
switch (_type) {
100102
case "user":
101103
githubSearchData.object.per_page = undefined;

dist/angular-github-api-factory.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-github-api-factory",
3-
"version": "0.5.0",
3+
"version": "0.5.1",
44
"description": "angularjs factory for github json rest api requests",
55
"main": "dist/angular-github-api-factory.js",
66
"scripts": {

src/angular-github-api-factory.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,18 @@ angular.module("jtt_github", [])
7979

8080
this.getNew = function (_type, _params) {
8181
var githubSearchData = {
82-
object: {
83-
access_token: _params.access_token,
84-
},
82+
object: {},
8583
url: "",
8684
};
8785

8886
if (angular.isDefined(_params.per_page)) {
8987
githubSearchData.object.per_page = _params.per_page;
9088
}
9189

90+
if (angular.isDefined(_params.access_token)) {
91+
githubSearchData.object.access_token = _params.access_token;
92+
}
93+
9294
switch (_type) {
9395
case "user":
9496
githubSearchData.object.per_page = undefined;

0 commit comments

Comments
 (0)