0

Working on an app built using Ember.js and Rails.
Authentication is being done with ember-simple-auth using Oauth2.
I am able to login to my app locally in my development environment, but as soon as I try to login on my production server (through Heroku) I start receiving a nginx 405 not allowed status code.

First thing I thought was maybe it is my request headers / CORS. I am using rack-cors gem on my rails side and configured it based directly off the readme example. Here is my application.rb

Researching, I found the same problem with the solution being to configure Nginx side of things, but I figured since that is being handled by heroku I wasn't really sure if that was where I need to make my changes.

Let me know if there are any other files/info that could help.

What is the best way to debug this problem?

enter image description here

Tyler Davis
  • 873
  • 7
  • 15

1 Answers1

0

Try using this first to rule out CORS:

https://chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi

Does the route work locally when you use Postman or a similar tool?

Are you requesting HTML or JSON?

Bricky
  • 2,572
  • 14
  • 30
  • thanks for the reply, I'll give a shot at Postman and that allow-control-allow-origin extension and let you know how it goes – Tyler Davis Jan 03 '18 at 22:23
  • when using Postman, I got my token available, and running post to localhost:3000/token keeps giving me a 500 error "ArgumentError: Missing authorization code". I pressed Use Token before doing so. – Tyler Davis Jan 04 '18 at 00:31
  • a little more specifically I'm having issues somewhere in here https://github.com/datadazer/Bidtracker/blob/master/bidtracker-api/app/controllers/tokens_controller.rb#L25-L35 only while trying to use Postman to send a POST request. On the other hand, my local version by hitting the login button seems to work fine. Also I'm using JSON in case I didn't state that previously. – Tyler Davis Jan 04 '18 at 21:35