ruby on rails - Heroku before_action :require_user, except: :auth being run for auth -
i have simple before action requires user passed, though when authenticating don't require it. works locally, when running same tests (using postman) on code on heroku, error associated :require_user method. write simple illustration of i'm trying below
before_action :require_user, except: [ :blah, :auth ] def auth # , render appropriate json end private def require_user @user = user.find_by(id: params[:id]) homecoming true if @user render json: { errors: 'could not find user' }, status: 400 end when seek auth method on heroku, could not find user homecoming value, must mean hitting require_user method...
and figured out... sending post blah.heroku.com instead of blah.herokuapp.com there redirect explained [1] still unknown reason messing , running before_action...
[1] https://devcenter.heroku.com/articles/error-codes#h16-redirect-to-herokuapp-com
ruby-on-rails ruby heroku
No comments:
Post a Comment