Webpack-dev-server and google oauth2


#1

I’m using webpack3 to bundle my project, and running it through webpack-dev-server during development. When I open the app link from the Share menu (upper right), I can get my initial landing page. However, when I click on my log-in link on that page, I’m taken to the standard Cloud9 App Preview splash page instead of actually being logged into my app for further dev work. The log-in goes through google oauth and I have my authorized uri’s and redirect uri’s set correctly in my google dev console. The only thing I can think of is something in my webpack.config.js file. Here is the relevant section:

devServer: {
    contentBase: "./public",
        proxy: {
    	   "/user": {
    	    	target: "https://fantasy-soccer-leagues-jstrother.c9users.io"
    	    }
        },
        hot: true,
        disableHostCheck: true
  }

I know that dev-server serves from http and c9 wants https, but if I set https: true, then I get a connection refused error and can’t get anything, not even my initial landing page. If I don’t have disableHostCheck: true set, then I get Invalid Host header. If I don’t have the proxy set at all, then instead of the Preview splash page I mentioned above, I get Cannot GET /user/auth/google.

Does anybody have any ideas? I can’t seem to find the answer anywhere, not even Stack Overflow.

Thanks in advance!


#2

Because this post is 8 days old, I’m now pagin @harutyun. You’ve helped me on issues before. Have you seen this post yet? Do you have any ideas?


#3

What happens when you click the open app button, do you get redirected to a wrong page?


#4

Nothing happens when I click open app, it stays on that page no matter how many times I click it.


#5

which browser do you use, do you have addons that disable cookies?
Right now when i go to https://fantasy-soccer-leagues-jstrother.c9users.io/ and click open app, i get to a page with No application seems to be running here! message


#6

I recently upgraded to the newest version of chrome and don’t use any
cookie blockers. I had the dev server turned it yesterday, but it is up
now. This time when you click to open the app, it’ll stay on the same page
saying you can open the app.


#7

Hey, @harutyun, I approved your collaboration request late last night. To
see the issue I’m talking about, run npm run dev and then start the
app. Click on the login link in the upper right corner and you’ll see that
the Google OAuth link isn’t working correctly. If you want to see the
routes, open the user-routes.js file in the server folder.

I’m at work currently and won’t be able to jump in until later this evening.

Thanks!