jimjeffers / rails-devise-cors-jwt-example

An example of a CORS configured rails 4 app that extends devise to pass a JWT during authentication.
101 stars 14 forks source link

when trying to run the application I get out and log #1

Closed drneox closed 9 years ago

drneox commented 9 years ago

{"error":"You need to sign in or sign up before continuing."}

jimjeffers commented 9 years ago

Can you add more context? What is the request you're sending to get that response?

scottbaggett commented 9 years ago

What is the route to POST to to sign in? POST /users/sign_in returns

{"error":"You need to sign in or sign up before continuing."}
jimjeffers commented 9 years ago

I've updated the example to allow for JSON based registration and updated the readme and JSON based responses so you should be able to authenticate successfully via JSON requests. This example was more so focused on how to properly verify the JWT and didn't cover the minimal setup required to make JSON based session creation / registration work.

scottbaggett commented 9 years ago

Much appreciated!

jimjeffers commented 9 years ago

@scottbaggett for more info on configuring Devise for JSON based sessions see this excellent post: http://blog.andrewray.me/how-to-set-up-devise-ajax-authentication-with-rails-4-0/

scottbaggett commented 9 years ago

WIll do, thanks again. :)