webpack / voting-app

An application for casting votes on new webpack features and fixes.

Home Page:https://webpack.js.org/vote

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Auth via GitHub failed

fishmandev opened this issue · comments

commented

Request URL: https://oswils44oj.execute-api.us-east-1.amazonaws.com/production//login
Status Code: 500 Internal Server Error
Response:

{
    "errorMessage": "[500] Github API user data request failed: {\"message\":\"Must specify access token via Authorization header. https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param\",\"documentation_url\":\"https://docs.github.com/v3/#oauth2-token-sent-in-a-header\"}",
    "errorType": "Error",
    "stackTrace": [
        "/var/task/handlers/login.js:43:28",
        "config.sendError (/var/task/node_modules/github/lib/index.js:798:13)",
        "/var/task/node_modules/github/lib/index.js:805:29",
        "callCallback (/var/task/node_modules/github/lib/index.js:680:17)",
        "IncomingMessage.<anonymous> (/var/task/node_modules/github/lib/index.js:736:25)",
        "emitNone (events.js:72:20)",
        "IncomingMessage.emit (events.js:166:7)",
        "endReadableNT (_stream_readable.js:905:12)",
        "nextTickCallbackWith2Args (node.js:437:9)",
        "process._tickDomainCallback (node.js:392:17)"
    ]
}

/cc @snitin315 @EugeneHlushko maybe you can look at this?

I can look into it, but it will take some time as I am not familiar with this repo and the GitHub API.

commented

@alexander-akait, is there a source code for the backend (oswils44oj.execute-api.us-east-1.amazonaws.com/production) on GitHub?

commented

Here the place https://github.com/webpack/voting-app/blob/master/src/utils/js/api.js wher we should change format

@alexander-akait , why do we need to change the format in this request?
It seems to me that everything is alright in this one, let's take a look
2

As you can see, the request was successful and returned with a 302 code:

https://github.com/login/oauth/authorize?client_id=4d355e2799cb8926c665&scope=user:email&state=0.42817076763951745&allow_signup=false&redirect_uri=https%3A%2F%2Fwebpack.js.org%2Fvote%2F

And from the second line:
https://webpack.js.org/vote/?code=8a9d69105a034ac2a5cc&state=0.42817076763951745
GitHub has successfully called a callback with the appropriate parameters.
It remains only to exchange the code for a token.

return fetch(API_URL + '/login', {

Sending a request to the backend server...

1

And instead of a token, we get a stack trace of errors

hm, our backed is broken...

commented

Is there its source code on github?

@skipjack maybe you know?

Oof, it’s been a while since I did the initial prototype. I believe @sokra put that backend together and I can’t recall whether it was pushed anywhere. Maybe not for security reasons, not sure. @sokra do you remember?