README.md in devise-token_authenticatable-0.1.0.beta1 vs README.md in devise-token_authenticatable-0.1.0

- old
+ new

@@ -1,11 +1,13 @@ # Devise::TokenAuthenticatable -**Note that this gem is not ready for usage, yet!** +[![Gem Version](https://badge.fury.io/rb/devise-token_authenticatable.png)](http://badge.fury.io/rb/devise-token_authenticatable) [![Build Status](https://travis-ci.org/baschtl/devise-token_authenticatable.png?branch=master)](https://travis-ci.org/baschtl/devise-token_authenticatable) [![Code Climate](https://codeclimate.com/github/baschtl/devise-token_authenticatable.png)](https://codeclimate.com/github/baschtl/devise-token_authenticatable) -TODO: Write a gem description +This gem provides the extracted Token Authenticatable module of devise. It includes the functionality that was also in [version 3.1.2](https://github.com/plataformatec/devise/tree/v3.1.2) of devise. With the inclusion of this module a user is able to sign in via an authentication token. This token can be given via a query string or HTTP Basic Authentication. This gem requires devise 3.2.0 or newer. +Use this gem as a starting point for your own token authentication mechanism for devise. Furthermore, if you need token authentication in connection with newer devise releases this gem might be an appropriate solution, too. + ## Installation Add this line to your application's Gemfile: gem 'devise-token_authenticatable' @@ -18,14 +20,29 @@ $ gem install devise-token_authenticatable ## Usage -TODO: Write usage instructions here +Add `:token_authenticatable` to your devise model: + class User < ActiveRecord::Base + devise :database_authenticatable, :token_authenticatable + end + +The authentication key name used by this module defaults to `auth_token`. Use the following configuration (e.g., in a Rails initializer) to alter the name: + + Devise::TokenAuthenticatable.setup do |config| + config.token_authentication_key = :other_key_name + end + +## Documentation + +For your convenience there is also a [source code documentation](http://rubydoc.info/github/baschtl/devise-token_authenticatable/master/frames). + ## Contributing -1. Fork it -2. Create your feature branch (`git checkout -b my-new-feature`) -3. Commit your changes (`git commit -am 'Add some feature'`) -4. Push to the branch (`git push origin my-new-feature`) -5. Create new Pull Request +1. Fork it. +2. Create your feature branch (`git checkout -b my-new-feature`). +3. Commit your changes (`git commit -am 'Add some feature'`). +4. Push to the branch (`git push origin my-new-feature`). +5. Create new Pull Request. +6. Get a thank you!