You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
First of all, thank you for this very usefull and time saving gem.
Thanks to it, I could integrate MFA with Authenticar apps.
However, when deploying the feature to the testing environement, it appeared to break the JSON API of the project.
I could more or less isolate the problem that I can describe like this:
Beside the usual web application, my Ruby on rails project runs an http API that inherits from ActionController::API.
Simply adding the gem to the Gemfile changes the behaviour of this API: the Content-Type header of the response is set to 'text/plain' instead of 'application/json' and the returned data is empty. This causes api clients to break.
If I comment the following lines of the gem, the Content-Type header is back to 'application/json', the data is OK and the API is fixed.
lib/google-authenticator-rails/action_controller/rails_adapter.rb, lines 44 ->46
if defined?(ActionController::API)
ActionController::API.send(:include, GoogleAuthenticatorRails::ActionController::Integration)
end
I am pretty novice to Ruby on Rails and I have to admit that I don't understand much of what's going under all this.
Do you have an idea of how I could fix or workaround the problem ?
The text was updated successfully, but these errors were encountered:
Heya @jivea sorry I've been slow to respond - I don't spend a lot of time on this project anymore.
I'm not really sure why adding the gem would change the response type of your API responses... I haven't encountered that before and there isn't anything in the project that should do that.
What version of Rails/Ruby/Bundler are you using? What other gems are in your gemfile?
Hello,
First of all, thank you for this very usefull and time saving gem.
Thanks to it, I could integrate MFA with Authenticar apps.
However, when deploying the feature to the testing environement, it appeared to break the JSON API of the project.
I could more or less isolate the problem that I can describe like this:
Beside the usual web application, my Ruby on rails project runs an http API that inherits from ActionController::API.
Simply adding the gem to the Gemfile changes the behaviour of this API: the Content-Type header of the response is set to 'text/plain' instead of 'application/json' and the returned data is empty. This causes api clients to break.
If I comment the following lines of the gem, the Content-Type header is back to 'application/json', the data is OK and the API is fixed.
lib/google-authenticator-rails/action_controller/rails_adapter.rb, lines 44 ->46
I am pretty novice to Ruby on Rails and I have to admit that I don't understand much of what's going under all this.
Do you have an idea of how I could fix or workaround the problem ?
The text was updated successfully, but these errors were encountered: