I'm building a app using emberjs and active_model_serializer.
I searched a lot to find out on how to implement the authentication/authorization with emberjs and rails, but couldn't.
Has anyone done this?
I am currently working on this kind of topic: I am using Devise, and have tried two kind of solutions:
I tried both and all is working well. To inconvenient with #1 is the 'old fashioned' blink at auth navigation. Solution #2 has my preference.
Here is an example of Devise auth wrapping in JSON:
class SessionsController < Devise::SessionsController
def create
resource = warden.authenticate!(auth_options)
sign_in(resource_name, resource)
render(json: resource, status: :ok) and return
end
...
The point that is still annoying me is that I had to completely override controller method, to avoid double rendering, as Devise is not yet designed to have customizable rendering.