Skip to content

Commit 503d2ff

Browse files
authored
Flip auth type (#1811)
* I'm guessing the failure that was encountered at #1705 (comment) may have been a fluke on the GH back-end. * GH Docs and blog posts are a little too vague for my tastes with `username` and `password`... however upon manual deconstruction and inspection of the *github* dep at https://github.com/OpenUserJS/rest.js/blob/29dedb3022649c27ac1dad79326270b6b2a48047/index.js#L730 it uses nearly what the maintainer mentioned at [the discussion](octokit/octokit.js#2070) and what joeytwiddle did at #1729 in the recently discovered dead code. *nodes* default for `Buffer` is `utf8` whereas *github*@0.2.4 via commit ref uses `ascii`. Since hashes usually only contain ASCII should not be an issue. * Newest dep at the time of testing with *@octokit/rest* for this seems to be unstable so going with this for a while since it currently gives the higher rate limit. This could change depending on what they do in the back-end. Applies to #1705 NOTE(s) * a GH url changed recently from https://github.com/octokit/rest.js to https://github.com/octokit/octokit.js ... may affect things even further. Auto-merge
1 parent a9247b8 commit 503d2ff

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

libs/githubClient.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,13 @@ Strategy.findOne({ name: 'github' }, async function (aErr, aStrat) {
5151
// TODO: Do something with `appAuthentication`
5252

5353

54-
// DEPRECATED: This method will break on May 5th, 2021. See #1705
55-
// and importing a repo will be severely hindered with possible timeouts/failures
54+
// DEPRECATED: See #1705
55+
// NOTE: We are technically an oauth app client but uses the same authentication type
56+
// methodology in the static version of the dependency. In future versions it may be different.
5657
github.authenticate({
57-
type: 'oauth',
58-
key: aStrat.id,
59-
secret: aStrat.key
58+
type: 'basic',
59+
username: aStrat.id,
60+
password: aStrat.key
6061
});
6162

6263
// TODO: error handler for UnhandledPromiseRejectionWarning if it crops up after deprecation.

0 commit comments

Comments
 (0)