Skip to content

jimjeffers/rails-devise-cors-jwt-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README

A simple example of configuring CORS and overriding Devise to pass a JWT when authenticating remotely via JSON.

You can view a screencast explaining this in detail here: www.youtube.com/watch?v=_CAq-F2icp4

Here is an example of a post request to create an account:

curl -H "Content-Type: application/json" \
     -X POST \
     -d '{"user":{"email":"test@example.com","password":"12345678","password_confirm":"12345678"}}' \
     http://localhost:3000/users.json

And to authenticate:

curl -H "Content-Type: application/json" \
      -X POST \
      -d '{"user": {"email":"test@example.com","password":"12345678"}}' \
      http://localhost:3000/users/sign_in.json

About

An example of a CORS configured rails 4 app that extends devise to pass a JWT during authentication.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published