Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2dee099

Browse files
committed
Simplified auth
1 parent 807498f commit 2dee099

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

github.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,8 @@
5454
};
5555
xhr.setRequestHeader('Accept','application/vnd.github.raw');
5656
xhr.setRequestHeader('Content-Type','application/json');
57-
if (
58-
(options.auth == 'oauth' && options.token) ||
59-
(options.auth == 'basic' && options.username && options.password)
60-
) {
61-
xhr.setRequestHeader('Authorization',options.auth == 'oauth'
57+
if ( (options.token) || (options.username && options.password)) {
58+
xhr.setRequestHeader('Authorization', options.token
6259
? 'token '+ options.token
6360
: 'Basic ' + Base64.encode(options.username + ':' + options.password)
6461
);

0 commit comments

Comments
 (0)