README.md in devise-ios-rails-1.0.0 vs README.md in devise-ios-rails-1.0.1

- old
+ new

@@ -54,9 +54,48 @@ acts_as_token_authentication_handler_for User skip_before_filter :authenticate_user_from_token!, only: [:new] end ``` +Facebook +======== + +To sign in using Facebook include DeviseIosRails::Oauth in your model after the devise method: + +```ruby +class User < ActiveRecord::Base + acts_as_token_authenticatable + devise :database_authenticatable, :registerable, + :recoverable, :rememberable, :validatable + + include DeviseIosRails::OAuth +end +``` + +Add required fields to the model (keep in mind that you might not get e-mail address from the provider): + +```ruby +class AddOauthToUsers < ActiveRecord::Migration + def change + add_column :users, :uid, :string + add_column :users, :provider, :string + add_column :users, :oauth_token, :string + + change_column :users, :email, :string, :null => true + + add_index :users, [:uid, :provider], unique: true + end +end +``` + +And update routes: + +```ruby +devise_scope :user do + post 'auth/facebook', to: 'devise_ios_rails/oauth#facebook' +end +``` + Example app =========== - [Rails with devise and Simple Authentication Token authentication][rails_example_app]