devise_token_auth 0.1.21.alpha2 → 0.1.23.alpha1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2a480547b2d43a6475cd6e9a0182ceb204f2fd8d
4
- data.tar.gz: 8b690b9d3390f156bfa02427bc6d2af282187b53
3
+ metadata.gz: bdad6abe21b7c1848bd5f8d29c186a8207c732af
4
+ data.tar.gz: 9aad078a90eb06a3f4f19da8215669b65bb12b52
5
5
  SHA512:
6
- metadata.gz: 932fc776673a4114055e7403f8d17e44575630743d6ac69dd7ae86d2089effcafcfd86b8b19007953bb084c4d09c34d23ddf522673c93edd9b669bf80aa3181b
7
- data.tar.gz: 80448a5ea78f8e2c9a211b51de8fad7cbeb5b135092cecfe5b89230f75487f1a63cf8f9edf233bea918be0614091f21ba81ec34f509a133c912c39f1c74dd093
6
+ metadata.gz: 43b0f67d17b1994aa29e61fc1002737bb49eac4dce6618b99e581fb47dd30aa2bf48d2c6b41887e587af8c6561fc57b93206551015efbef9a81a264e5038d9f8
7
+ data.tar.gz: b976ddd32096eb073a6f4a36a58dc6d86562b85d32eb985487149236a9e747c7cbf3ccc1bbf428bb8099106527142fdc9f48a525e09a263838d13e5e129d6769
data/README.md CHANGED
@@ -1,8 +1,9 @@
1
1
  # Devise Token Auth
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/devise_token_auth.svg)](http://badge.fury.io/rb/devise_token_auth)
3
4
  [![Build Status](https://travis-ci.org/lynndylanhurley/devise_token_auth.svg?branch=master)](https://travis-ci.org/lynndylanhurley/devise_token_auth)
4
- [![Code Climate](https://codeclimate.com/github/lynndylanhurley/devise_token_auth.png)](https://codeclimate.com/github/lynndylanhurley/devise_token_auth)
5
- [![Test Coverage](https://codeclimate.com/github/lynndylanhurley/devise_token_auth/coverage.png)](https://codeclimate.com/github/lynndylanhurley/devise_token_auth)
5
+ [![Code Climate](http://img.shields.io/codeclimate/github/lynndylanhurley/devise_token_auth.svg)](https://codeclimate.com/github/lynndylanhurley/devise_token_auth)
6
+ [![Test Coverage](http://img.shields.io/codeclimate/coverage/github/lynndylanhurley/devise_token_auth.svg)](https://codeclimate.com/github/lynndylanhurley/devise_token_auth)
6
7
  [![Dependency Status](https://gemnasium.com/lynndylanhurley/devise_token_auth.svg)](https://gemnasium.com/lynndylanhurley/devise_token_auth)
7
8
 
8
9
  This gem provides simple, secure token based authentication.
@@ -19,7 +20,7 @@ The fully configured api used in the demo can be found [here](https://github.com
19
20
  This project leverages the following gems:
20
21
 
21
22
  * [Devise](https://github.com/plataformatec/devise)
22
- * [Omniauth](https://github.com/intridea/omniauth)
23
+ * [OmniAuth](https://github.com/intridea/omniauth)
23
24
 
24
25
  # Installation
25
26
  Add the following to your `Gemfile`:
@@ -34,9 +35,9 @@ Then install the gem using bundle:
34
35
  bundle install
35
36
  ~~~
36
37
 
37
- # Configuration TLDR;
38
+ # Configuration TL;DR
38
39
 
39
- You will need to create a [user model](#model-concerns), [define routes](#mounting-routes), [include concerns](#controller-concerns), and you may want to alter some of the [default settings](#initializer-settings) for this gem. Run the following to append the routes and generate the model, migration, and initializer files:
40
+ You will need to create a [user model](#model-concerns), [define routes](#mounting-routes), [include concerns](#controller-concerns), and you may want to alter some of the [default settings](#initializer-settings) for this gem. Run the following command for an easy one-step installation:
40
41
 
41
42
  ~~~bash
42
43
  rails g devise_token_auth:install [USER_CLASS] [MOUNT_PATH]
@@ -65,15 +66,16 @@ The following events will take place when using the install generator:
65
66
  rake db:migrate
66
67
  ~~~
67
68
 
68
- You will also need to configure the following features that are external to this gem:
69
+ You may also need to configure the following items:
69
70
 
70
- * [Omniauth providers](#omniauth-authentication) for 3rd party oauth2 authentication.
71
- * [Cross Origin Request Settings](#cors) when using cross-domain clients.
72
- * [Email](#email-authentication) for email registration.
71
+ * **OmniAuth providers** when using 3rd party oauth2 authentication. [Read more](#omniauth-authentication).
72
+ * **Cross Origin Request Settings** when using cross-domain clients. [Read more](#cors).
73
+ * **Email** when using email registration. [Read more](#email-authentication).
74
+ * **Multiple model support** may require additional steps. [Read more](#using-multiple-models).
73
75
 
74
76
  [Jump here](#configuration-cont) for more configuration information.
75
77
 
76
- # Usage TLDR;
78
+ # Usage TL;DR
77
79
 
78
80
  The following routes are available for use by your client. These routes live relative to the path at which this engine is mounted (`/auth` by default). These routes correspond to the defaults used by the [ng-token-auth](https://github.com/lynndylanhurley/ng-token-auth) module for angular.js.
79
81
 
@@ -105,22 +107,22 @@ The following settings are available for configuration in `config/initializers/d
105
107
  | **`omniauth_prefix`** | `"/omniauth"` | This route will be the prefix for all oauth2 redirect callbacks. For example, using the default '/omniauth' setting, the github oauth2 provider will redirect successful authentications to '/omniauth/github/callback'. [Read more](#omniauth-provider-settings). |
106
108
 
107
109
 
108
- ## Omniauth authentication
110
+ ## OmniAuth authentication
109
111
 
110
112
  If you wish to use omniauth authentication, add all of your desired authentication provider gems to your `Gemfile`.
111
113
 
112
- **Omniauth example using github, facebook, and google**:
114
+ **OmniAuth example using github, facebook, and google**:
113
115
  ~~~ruby
114
- gem 'omniauth-github', :git => 'git://github.com/intridea/omniauth-github.git'
115
- gem 'omniauth-facebook', :git => 'git://github.com/mkdynamic/omniauth-facebook.git'
116
- gem 'omniauth-google-oauth2', :git => 'git://github.com/zquestz/omniauth-google-oauth2.git'
116
+ gem 'omniauth-github'
117
+ gem 'omniauth-facebook'
118
+ gem 'omniauth-google-oauth2'
117
119
  ~~~
118
120
 
119
121
  Then run `bundle install`.
120
122
 
121
123
  [List of oauth2 providers](https://github.com/intridea/omniauth/wiki/List-of-Strategies)
122
124
 
123
- ## Omniauth provider settings
125
+ ## OmniAuth provider settings
124
126
 
125
127
  In `config/initializers/omniauth.rb`, add the settings for each of your providers.
126
128
 
@@ -138,9 +140,9 @@ end
138
140
 
139
141
  The above example assumes that your provider keys and secrets are stored in environmental variables. Use the [figaro](https://github.com/laserlemon/figaro) gem (or [dotenv](https://github.com/bkeepers/dotenv) or [secrets.yml](https://github.com/rails/rails/blob/v4.1.0/railties/lib/rails/generators/rails/app/templates/config/secrets.yml) or equivalent) to accomplish this.
140
142
 
141
- #### Omniauth callback settings
143
+ #### OmniAuth callback settings
142
144
 
143
- The "Callback URL" setting that you set with your provider must correspond to the [omniauth prefix](#initializer-settings) setting defined by this app. **This will be different than the omniauth route that is used by your client application**.
145
+ The "Callback URL" setting that you set with your provider must correspond to the [omniauth prefix](#initializer-settings) setting defined by this app. **This will be different than the omniauth route that is used by your client application**.
144
146
 
145
147
  For example, the demo app uses the default `omniauth_prefix` setting `/omniauth`, so the "Authorization callback URL" for github must be set to "http://devise-token-auth-demo.herokuapp.com**/omniauth**/github/callback".
146
148
 
@@ -171,7 +173,7 @@ angular.module('myApp', ['ng-token-auth'])
171
173
  });
172
174
  ~~~
173
175
 
174
- This incongruence is necessary to support multiple user classes and mounting points.
176
+ This incongruence is necessary to support multiple user classes and mounting points.
175
177
 
176
178
  #### Note for [pow](http://pow.cx/) and [xip.io](http://xip.io) users
177
179
 
@@ -204,9 +206,9 @@ end
204
206
 
205
207
  ## CORS
206
208
 
207
- If your API and client live on different domains, you will need to configure your Rails API to allow cross origin requests. The [rack-cors](https://github.com/cyu/rack-cors) gem can be used to accomplish this.
209
+ If your API and client live on different domains, you will need to configure your Rails API to allow [cross origin requests](http://en.wikipedia.org/wiki/Cross-origin_resource_sharing). The [rack-cors](https://github.com/cyu/rack-cors) gem can be used to accomplish this.
208
210
 
209
- The following example will allow cross domain requests from any domain.
211
+ The following **dangerous** example will allow cross domain requests from **any** domain. Make sure to whitelist only the needed domains.
210
212
 
211
213
  ##### Example rack-cors configuration:
212
214
  ~~~ruby
@@ -241,10 +243,10 @@ The authentication routes must be mounted to your project. This gem includes a r
241
243
 
242
244
  **`mount_devise_token_auth_for`** - similar to `devise_for`, this method is used to append the routes necessary for user authentication. This method accepts the following arguments:
243
245
 
244
- | Argument | Type | Description |
245
- |---|---|---|
246
- |`class_name`| string | The name of the class to use for authentication. This class must include the [model concern described here](#model-concerns). |
247
- | `options` | object | The [routes to be used for authentication](#usage) will be prefixed by the path specified in the `at` param of this object. |
246
+ | Argument | Type | Default | Description |
247
+ |---|---|---|---|
248
+ |`class_name`| string | 'User' | The name of the class to use for authentication. This class must include the [model concern described here](#model-concerns). |
249
+ | `options` | object | {at: '/auth'} | The [routes to be used for authentication](#usage) will be prefixed by the path specified in the `at` param of this object. |
248
250
 
249
251
  **Example**:
250
252
  ~~~ruby
@@ -252,6 +254,8 @@ The authentication routes must be mounted to your project. This gem includes a r
252
254
  mount_devise_token_auth_for 'User', at: '/auth'
253
255
  ~~~
254
256
 
257
+ Any model class can be used, but the class will need to include [`DeviseTokenAuth::Concerns::SetUserByToken`](#model-concerns) for authentication to work properly.
258
+
255
259
  You can mount this engine to any route that you like. `/auth` is used by default to conform with the defaults of the [ng-token-auth](https://github.com/lynndylanhurley/ng-token-auth) module.
256
260
 
257
261
 
@@ -259,7 +263,7 @@ You can mount this engine to any route that you like. `/auth` is used by default
259
263
 
260
264
  ##### DeviseTokenAuth::Concerns::SetUserByToken
261
265
 
262
- This gem includes a [Rails concern](http://api.rubyonrails.org/classes/ActiveSupport/Concern.html) called `DeviseTokenAuth::Concerns::SetUserByToken`. This concern can be used can be used in controllers to identify users by their `Authorization` header.
266
+ This gem includes a [Rails concern](http://api.rubyonrails.org/classes/ActiveSupport/Concern.html) called `DeviseTokenAuth::Concerns::SetUserByToken`. This concern can be used in controllers to identify users by their `Authorization` header.
263
267
 
264
268
  This concern runs a [before_action](http://guides.rubyonrails.org/action_controller_overview.html#filters), setting the `@user` variable for use in your controllers. The user will be signed in via devise for the duration of the request.
265
269
 
@@ -304,7 +308,7 @@ The `Authorization` header is made up of the following components:
304
308
  * **`token`**: This serves as the user's password for each request. A hashed version of this value is stored in the database for later comparison. This value should be changed on each request.
305
309
  * **`client`**: This enables the use of multiple simultaneous sessions on different clients. (For example, a user may want to be authenticated on both their phone and their laptop at the same time.)
306
310
  * **`expiry`**: The date at which the current session will expire. This can be used by clients to invalidate expired tokens without the need for an API request.
307
- * **`uid`**: A unique value that is used to identify the user. This is necessary because searching the DB for users by their access token will open the API up to timing attacks.
311
+ * **`uid`**: A unique value that is used to identify the user. This is necessary because searching the DB for users by their access token will open the API up to [timing attacks](http://codahale.com/a-lesson-in-timing-attacks/).
308
312
 
309
313
  The `Authorization` header required for each request will be available in the response from the previous request. If you are using the [ng-token-auth](https://github.com/lynndylanhurley/ng-token-auth) module for angular.js, this functionality is already provided.
310
314
 
@@ -328,12 +332,12 @@ Models that include the `DeviseTokenAuth::Concerns::SetUserByToken` concern will
328
332
  ~~~
329
333
 
330
334
  * **`create_new_auth_token`**: creates a new auth token with all of the necessary metadata. Accepts `client` as an optional argument. Will generate a new `client` if none is provided. Returns the `Authorization` header that should be sent by the client as a string.
331
-
335
+
332
336
  **Example**:
333
337
  ~~~ruby
334
338
  # extract client_id from auth header
335
339
  client_id = request.headers['Authorization'][/client=(.*?) /,1]
336
-
340
+
337
341
  # update token, generate updated auth headers for response
338
342
  new_auth_header = @user.create_new_auth_token(client_id)
339
343
 
@@ -355,8 +359,8 @@ Models that include the `DeviseTokenAuth::Concerns::SetUserByToken` concern will
355
359
  expiry: (Time.now + DeviseTokenAuth.token_lifespan).to_i
356
360
  }
357
361
 
358
- # update token, generate updated auth headers for response
359
- new_auth_header = @user.create_new_auth_token(token, client_id)
362
+ # generate auth headers for response
363
+ new_auth_header = @user.build_auth_header(token, client_id)
360
364
 
361
365
  # update response with the header that will be required by the next request
362
366
  response.headers["Authorization"] = new_auth_header
@@ -364,7 +368,7 @@ Models that include the `DeviseTokenAuth::Concerns::SetUserByToken` concern will
364
368
 
365
369
  ## Using multiple models
366
370
 
367
- This gem supports the use of multiple user models. One possible use case is to authorize visitors using a model called `User`, and to authorize administrators with a model called `Admin` from the same app. Take the following steps to add another authentication model to your app:
371
+ This gem supports the use of multiple user models. One possible use case is to authenticate visitors using a model called `User`, and to authenticate administrators with a model called `Admin`. Take the following steps to add another authentication model to your app:
368
372
 
369
373
  1. Run the install generator for the new model.
370
374
  ~~~
@@ -377,26 +381,26 @@ This gem supports the use of multiple user models. One possible use case is to a
377
381
 
378
382
  **Example**:
379
383
  ~~~ruby
380
- Rails.application.routes.draw do
381
- # when using multiple models, controllers will default to the first available
382
- # devise mapping. routes for subsequent devise mappings will need to defined
383
- # within a `devise_scope` block
384
+ Rails.application.routes.draw do
385
+ # when using multiple models, controllers will default to the first available
386
+ # devise mapping. routes for subsequent devise mappings will need to defined
387
+ # within a `devise_scope` block
384
388
 
385
- # define :users as the first devise mapping:
386
- mount_devise_token_auth_for 'User', at: '/auth'
389
+ # define :users as the first devise mapping:
390
+ mount_devise_token_auth_for 'User', at: '/auth'
387
391
 
388
- # define :admins as the second devise mapping. routes using this class will
389
- # need to be defined within a devise_scope as shown below
390
- mount_devise_token_auth_for "Admin", at: '/admin_auth'
392
+ # define :admins as the second devise mapping. routes using this class will
393
+ # need to be defined within a devise_scope as shown below
394
+ mount_devise_token_auth_for "Admin", at: '/admin_auth'
391
395
 
392
- # this route will authorize visitors using the User class
393
- get 'demo/members_only', to: 'demo#members_only'
396
+ # this route will authorize requests using the User class
397
+ get 'demo/members_only', to: 'demo#members_only'
394
398
 
395
- # routes within this block will authorize visitors using the Admin class
396
- devise_scope :admin do
397
- get 'demo/admins_only', to: 'demo#admins_only'
399
+ # routes within this block will authorize requests using the Admin class
400
+ devise_scope :admin do
401
+ get 'demo/admins_only', to: 'demo#admins_only'
402
+ end
398
403
  end
399
- end
400
404
  ~~~
401
405
 
402
406
  # Conceptual
@@ -459,7 +463,7 @@ This gem uses auth tokens that are:
459
463
  * [of cryptographic strength](http://ruby-doc.org/stdlib-2.1.0/libdoc/securerandom/rdoc/SecureRandom.html),
460
464
  * hashed using [BCrypt](https://github.com/codahale/bcrypt-ruby) (not stored in plain-text),
461
465
  * securely compared (to protect against timing attacks),
462
- * invalidated after 2 weeks
466
+ * invalidated after 2 weeks (thus requiring users to login again)
463
467
 
464
468
  These measures were inspired by [this stackoverflow post](http://stackoverflow.com/questions/18605294/is-devises-token-authenticatable-secure).
465
469
 
@@ -10,6 +10,8 @@ module DeviseTokenAuth::Concerns::SetUserByToken
10
10
  def set_user_by_token
11
11
  auth_header = request.headers["Authorization"]
12
12
 
13
+ #binding.pry_remote
14
+
13
15
  # missing auth token
14
16
  return false unless auth_header
15
17
 
@@ -73,6 +75,6 @@ module DeviseTokenAuth::Concerns::SetUserByToken
73
75
  def is_batch_request?(user, client_id)
74
76
  user.tokens[client_id] and
75
77
  user.tokens[client_id]['updated_at'] and
76
- user.tokens[client_id]['updated_at'] > Time.now - DeviseTokenAuth.batch_request_buffer_throttle
78
+ Time.parse(user.tokens[client_id]['updated_at']) > Time.now - DeviseTokenAuth.batch_request_buffer_throttle
77
79
  end
78
80
  end
@@ -1,3 +1,3 @@
1
1
  module DeviseTokenAuth
2
- VERSION = "0.1.21.alpha2"
2
+ VERSION = "0.1.23.alpha1"
3
3
  end
@@ -24,7 +24,7 @@ module DeviseTokenAuth
24
24
 
25
25
  def create_user_model
26
26
  fname = "app/models/#{ user_class.underscore }.rb"
27
- unless File.exist?(fname)
27
+ unless File.exist?(File.join(destination_root, fname))
28
28
  template("user.rb", fname)
29
29
  else
30
30
  inclusion = "include DeviseTokenAuth::Concerns::User"
@@ -41,40 +41,49 @@ module DeviseTokenAuth
41
41
  fname = "app/controllers/application_controller.rb"
42
42
  line = "include DeviseTokenAuth::Concerns::SetUserByToken"
43
43
 
44
- if parse_file_for_line(fname, line)
45
- say_status("skipped", "Concern is already included in the application controller.")
46
- else
47
- inject_into_file fname, after: "class ApplicationController < ActionController::Base\n" do <<-'RUBY'
44
+ if File.exist?(File.join(destination_root, fname))
45
+ if parse_file_for_line(fname, line)
46
+ say_status("skipped", "Concern is already included in the application controller.")
47
+ else
48
+ inject_into_file fname, after: "class ApplicationController < ActionController::Base\n" do <<-'RUBY'
48
49
  include DeviseTokenAuth::Concerns::SetUserByToken
49
- RUBY
50
+ RUBY
51
+ end
50
52
  end
53
+ else
54
+ say_status("skipped", "app/controllers/application_controller.rb not found. Add 'include DeviseTokenAuth::Concerns::SetUserByToken' to any controllers that require authentication.")
51
55
  end
52
56
  end
53
57
 
54
58
  def add_route_mount
55
59
  f = "config/routes.rb"
56
60
  str = "mount_devise_token_auth_for '#{user_class}', at: '#{mount_path}'"
57
- line = parse_file_for_line(f, "mount_devise_token_auth_for")
58
61
 
59
- unless line
60
- line = "Rails.application.routes.draw do"
61
- existing_user_class = false
62
- else
63
- existing_user_class = true
64
- end
62
+ if File.exist?(File.join(destination_root, f))
63
+ line = parse_file_for_line(f, "mount_devise_token_auth_for")
65
64
 
66
- if parse_file_for_line(f, str)
67
- say_status("skipped", "Routes already exist for #{user_class} at #{mount_path}")
68
- else
69
- insert_after_line(f, line, str)
70
-
71
- if existing_user_class
72
- scoped_routes = ""+
73
- "as :#{user_class.underscore} do\n"+
74
- " # Define routes for #{user_class} within this block.\n"+
75
- " end\n"
76
- insert_after_line(f, str, scoped_routes)
65
+ unless line
66
+ line = "Rails.application.routes.draw do"
67
+ existing_user_class = false
68
+ else
69
+ existing_user_class = true
77
70
  end
71
+
72
+ if parse_file_for_line(f, str)
73
+ say_status("skipped", "Routes already exist for #{user_class} at #{mount_path}")
74
+ else
75
+ insert_after_line(f, line, str)
76
+
77
+ if existing_user_class
78
+ scoped_routes = ""+
79
+ "as :#{user_class.underscore} do\n"+
80
+ " # Define routes for #{user_class} within this block.\n"+
81
+ " end\n"
82
+ insert_after_line(f, str, scoped_routes)
83
+ end
84
+ end
85
+ else
86
+ say_status("skipped", "config/routes.rb not found. Add \"mount_devise_token_auth_for '#{user_class}', at: '#{mount_path}'\" to your routes file.")
78
87
  end
79
88
  end
80
89
 
@@ -92,7 +101,8 @@ module DeviseTokenAuth
92
101
 
93
102
  def parse_file_for_line(filename, str)
94
103
  match = false
95
- File.open(filename) do |f|
104
+
105
+ File.open(File.join(destination_root, filename)) do |f|
96
106
  f.each_line do |line|
97
107
  if line =~ /(#{Regexp.escape(str)})/mi
98
108
  match = line
@@ -1,9 +1,9 @@
1
1
  # Add application configuration variables here, as shown below.
2
- GITHUB_KEY: 4c78f513d7a412319c52
3
- GITHUB_SECRET: 6b82c1ea92425022d95d9dbcb75289b24417e626
2
+ GITHUB_KEY: "4c78f513d7a412319c52"
3
+ GITHUB_SECRET: "6b82c1ea92425022d95d9dbcb75289b24417e626"
4
4
 
5
- FACEBOOK_KEY: 519048964889141
6
- FACEBOOK_SECRET: 40b7a0506495382818983f10883f4d5b
5
+ FACEBOOK_KEY: "519048964889141"
6
+ FACEBOOK_SECRET: "40b7a0506495382818983f10883f4d5b"
7
7
 
8
- GOOGLE_KEY: 276861244411-b1m3bteiuvraajilmcf8rvh83v5n4dp2.apps.googleusercontent.com
9
- GOOGLE_SECRET: A9_CLZNIvPAY-T09fBiaKPEI
8
+ GOOGLE_KEY: "276861244411-b1m3bteiuvraajilmcf8rvh83v5n4dp2.apps.googleusercontent.com"
9
+ GOOGLE_SECRET: "A9_CLZNIvPAY-T09fBiaKPEI"
Binary file
Binary file
@@ -36996,3 +36996,131 @@ Started DELETE "/auth/sign_out" for 127.0.0.1 at 2014-07-16 19:46:53 -0500
36996
36996
  Processing by DeviseTokenAuth::SessionsController#destroy as HTML
36997
36997
  User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = '468037' LIMIT 1
36998
36998
  Completed 200 OK in 62ms (Views: 0.2ms | ActiveRecord: 0.2ms)
36999
+
37000
+
37001
+ Started GET "/auth/github?auth_origin_url=http://ng-token-auth.dev/" for 127.0.0.1 at 2014-07-16 22:53:35 -0500
37002
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
37003
+
37004
+
37005
+ Started GET "/omniauth/github?auth_origin_url=http%3A%2F%2Fng-token-auth.dev%2F&resource_class=User" for 127.0.0.1 at 2014-07-16 22:53:35 -0500
37006
+
37007
+
37008
+ Started GET "/omniauth/github/callback?code=02a5d64d51b77f025bc9&state=504572f3299a8d58e182304f87a3f16754cdc137184f8240" for 127.0.0.1 at 2014-07-16 22:53:35 -0500
37009
+ Processing by DeviseTokenAuth::AuthController#omniauth_success as HTML
37010
+ Parameters: {"code"=>"02a5d64d51b77f025bc9", "state"=>"504572f3299a8d58e182304f87a3f16754cdc137184f8240", "provider"=>"github"}
37011
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."uid" = '468037' AND "users"."provider" = 'github' ORDER BY "users"."id" ASC LIMIT 1
37012
+  (0.1ms) begin transaction
37013
+ SQL (0.3ms) UPDATE "users" SET "confirmed_at" = ?, "tokens" = ?, "updated_at" = ? WHERE "users"."id" = 1 [["confirmed_at", "2014-07-17 03:53:36.324507"], ["tokens", "{\"w_an0weNUDKhTtD2swV-0w\":{\"token\":\"$2a$10$TuXDtuTVo7j9SgjGrpFfheb883mJm.o.NfK2WRf4tBnUyqG8VaoaS\",\"expiry\":1406673401,\"last_token\":\"$2a$10$H/aacu1zhX7sPIZLrcBJf.L6AMZIEpWK3Y3.WWEbISi4br5Y/oQbi\",\"updated_at\":\"2014-07-15 17:36:41 -0500\"},\"JpkotX_5GMZTxCA3Kr6LSg\":{\"token\":\"$2a$10$xLT6URzVbql5Avfp5mNlpu.GNFju.QdYhSCMQmF/0eC8LNGoxS5MW\",\"expiry\":1406767570,\"last_token\":\"$2a$10$pBPj.THu5cDlfWqmbcUt9uXw9oEjtvq1/GtXQtk7CbW68YSivSfvW\",\"updated_at\":\"2014-07-16 19:46:15 -0500\"},\"506KuB-C-2mKsW6PO5BHCg\":{\"token\":\"$2a$10$ltjKp73qzSd2h.YPgdFHWO/ZT68yJzOMt3W2oqJu3JwwQuvrwG46W\",\"expiry\":1406767597,\"last_token\":\"$2a$10$0mxS.YawQiGPNWLXvXHqzu.SzA9R2vEjXc1UvD6Jl1rhJOq7IC.ii\",\"updated_at\":\"2014-07-16 19:46:37 -0500\"},\"D5CEgvw0vNDrg9YW4spS_g\":{\"token\":\"$2a$10$YxRLETQUHNcrSe4NCfp36esWrmy3d5Fqij9N76xRzTu1Ql1COPYVa\",\"expiry\":1406778816}}"], ["updated_at", "2014-07-17 03:53:36.327135"]]
37014
+  (1.8ms) commit transaction
37015
+ Rendered /Users/lynnhurley/Code/Auth/devise_token_auth/app/views/devise_token_auth/omniauth_success.html.erb within layouts/omniauth_response (1.3ms)
37016
+ Completed 200 OK in 92ms (Views: 7.1ms | ActiveRecord: 2.6ms)
37017
+
37018
+
37019
+ Started OPTIONS "/demo/members_only" for 127.0.0.1 at 2014-07-16 22:53:39 -0500
37020
+
37021
+
37022
+ Started GET "/demo/members_only" for 127.0.0.1 at 2014-07-16 22:53:40 -0500
37023
+ Processing by DemoController#members_only as HTML
37024
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = '468037' LIMIT 1
37025
+  (0.1ms) begin transaction
37026
+ SQL (0.3ms) UPDATE "users" SET "tokens" = ?, "updated_at" = ? WHERE "users"."id" = 1 [["tokens", "{\"w_an0weNUDKhTtD2swV-0w\":{\"token\":\"$2a$10$TuXDtuTVo7j9SgjGrpFfheb883mJm.o.NfK2WRf4tBnUyqG8VaoaS\",\"expiry\":1406673401,\"last_token\":\"$2a$10$H/aacu1zhX7sPIZLrcBJf.L6AMZIEpWK3Y3.WWEbISi4br5Y/oQbi\",\"updated_at\":\"2014-07-15 17:36:41 -0500\"},\"JpkotX_5GMZTxCA3Kr6LSg\":{\"token\":\"$2a$10$xLT6URzVbql5Avfp5mNlpu.GNFju.QdYhSCMQmF/0eC8LNGoxS5MW\",\"expiry\":1406767570,\"last_token\":\"$2a$10$pBPj.THu5cDlfWqmbcUt9uXw9oEjtvq1/GtXQtk7CbW68YSivSfvW\",\"updated_at\":\"2014-07-16 19:46:15 -0500\"},\"506KuB-C-2mKsW6PO5BHCg\":{\"token\":\"$2a$10$ltjKp73qzSd2h.YPgdFHWO/ZT68yJzOMt3W2oqJu3JwwQuvrwG46W\",\"expiry\":1406767597,\"last_token\":\"$2a$10$0mxS.YawQiGPNWLXvXHqzu.SzA9R2vEjXc1UvD6Jl1rhJOq7IC.ii\",\"updated_at\":\"2014-07-16 19:46:37 -0500\"},\"D5CEgvw0vNDrg9YW4spS_g\":{\"token\":\"$2a$10$l0KoYQNx95TDUNrVg84Q3OpXyrCRajgW.Q4VABwYOQhsvFwfCuYS2\",\"expiry\":1406778820,\"last_token\":\"$2a$10$YxRLETQUHNcrSe4NCfp36esWrmy3d5Fqij9N76xRzTu1Ql1COPYVa\",\"updated_at\":\"2014-07-16 22:53:40 -0500\"}}"], ["updated_at", "2014-07-17 03:53:40.140490"]]
37027
+  (1.7ms) commit transaction
37028
+ Completed 200 OK in 128ms (Views: 0.7ms | ActiveRecord: 2.3ms)
37029
+
37030
+
37031
+ Started GET "/demo/members_only" for 127.0.0.1 at 2014-07-16 22:53:42 -0500
37032
+ Processing by DemoController#members_only as HTML
37033
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = '468037' LIMIT 1
37034
+  (0.1ms) begin transaction
37035
+ SQL (0.2ms) UPDATE "users" SET "tokens" = ?, "updated_at" = ? WHERE "users"."id" = 1 [["tokens", "{\"w_an0weNUDKhTtD2swV-0w\":{\"token\":\"$2a$10$TuXDtuTVo7j9SgjGrpFfheb883mJm.o.NfK2WRf4tBnUyqG8VaoaS\",\"expiry\":1406673401,\"last_token\":\"$2a$10$H/aacu1zhX7sPIZLrcBJf.L6AMZIEpWK3Y3.WWEbISi4br5Y/oQbi\",\"updated_at\":\"2014-07-15 17:36:41 -0500\"},\"JpkotX_5GMZTxCA3Kr6LSg\":{\"token\":\"$2a$10$xLT6URzVbql5Avfp5mNlpu.GNFju.QdYhSCMQmF/0eC8LNGoxS5MW\",\"expiry\":1406767570,\"last_token\":\"$2a$10$pBPj.THu5cDlfWqmbcUt9uXw9oEjtvq1/GtXQtk7CbW68YSivSfvW\",\"updated_at\":\"2014-07-16 19:46:15 -0500\"},\"506KuB-C-2mKsW6PO5BHCg\":{\"token\":\"$2a$10$ltjKp73qzSd2h.YPgdFHWO/ZT68yJzOMt3W2oqJu3JwwQuvrwG46W\",\"expiry\":1406767597,\"last_token\":\"$2a$10$0mxS.YawQiGPNWLXvXHqzu.SzA9R2vEjXc1UvD6Jl1rhJOq7IC.ii\",\"updated_at\":\"2014-07-16 19:46:37 -0500\"},\"D5CEgvw0vNDrg9YW4spS_g\":{\"token\":\"$2a$10$l0KoYQNx95TDUNrVg84Q3OpXyrCRajgW.Q4VABwYOQhsvFwfCuYS2\",\"expiry\":1406778820,\"last_token\":\"$2a$10$YxRLETQUHNcrSe4NCfp36esWrmy3d5Fqij9N76xRzTu1Ql1COPYVa\",\"updated_at\":\"2014-07-16 22:53:42 -0500\"}}"], ["updated_at", "2014-07-17 03:53:42.361753"]]
37036
+  (1.6ms) commit transaction
37037
+ Completed 200 OK in 67ms (Views: 0.7ms | ActiveRecord: 2.0ms)
37038
+
37039
+
37040
+ Started GET "/demo/members_only" for 127.0.0.1 at 2014-07-16 22:53:44 -0500
37041
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
37042
+ Processing by DemoController#members_only as HTML
37043
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = '468037' LIMIT 1
37044
+  (0.1ms) begin transaction
37045
+ SQL (0.3ms) UPDATE "users" SET "tokens" = ?, "updated_at" = ? WHERE "users"."id" = 1 [["tokens", "{\"w_an0weNUDKhTtD2swV-0w\":{\"token\":\"$2a$10$TuXDtuTVo7j9SgjGrpFfheb883mJm.o.NfK2WRf4tBnUyqG8VaoaS\",\"expiry\":1406673401,\"last_token\":\"$2a$10$H/aacu1zhX7sPIZLrcBJf.L6AMZIEpWK3Y3.WWEbISi4br5Y/oQbi\",\"updated_at\":\"2014-07-15 17:36:41 -0500\"},\"JpkotX_5GMZTxCA3Kr6LSg\":{\"token\":\"$2a$10$xLT6URzVbql5Avfp5mNlpu.GNFju.QdYhSCMQmF/0eC8LNGoxS5MW\",\"expiry\":1406767570,\"last_token\":\"$2a$10$pBPj.THu5cDlfWqmbcUt9uXw9oEjtvq1/GtXQtk7CbW68YSivSfvW\",\"updated_at\":\"2014-07-16 19:46:15 -0500\"},\"506KuB-C-2mKsW6PO5BHCg\":{\"token\":\"$2a$10$ltjKp73qzSd2h.YPgdFHWO/ZT68yJzOMt3W2oqJu3JwwQuvrwG46W\",\"expiry\":1406767597,\"last_token\":\"$2a$10$0mxS.YawQiGPNWLXvXHqzu.SzA9R2vEjXc1UvD6Jl1rhJOq7IC.ii\",\"updated_at\":\"2014-07-16 19:46:37 -0500\"},\"D5CEgvw0vNDrg9YW4spS_g\":{\"token\":\"$2a$10$l0KoYQNx95TDUNrVg84Q3OpXyrCRajgW.Q4VABwYOQhsvFwfCuYS2\",\"expiry\":1406778820,\"last_token\":\"$2a$10$YxRLETQUHNcrSe4NCfp36esWrmy3d5Fqij9N76xRzTu1Ql1COPYVa\",\"updated_at\":\"2014-07-16 22:53:44 -0500\"}}"], ["updated_at", "2014-07-17 03:53:44.339912"]]
37046
+  (1.7ms) commit transaction
37047
+ Completed 200 OK in 91ms (Views: 0.7ms | ActiveRecord: 2.6ms)
37048
+
37049
+
37050
+ Started OPTIONS "/auth/sign_out" for 127.0.0.1 at 2014-07-16 22:53:47 -0500
37051
+
37052
+
37053
+ Started DELETE "/auth/sign_out" for 127.0.0.1 at 2014-07-16 22:53:47 -0500
37054
+ Processing by DeviseTokenAuth::SessionsController#destroy as HTML
37055
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = '468037' LIMIT 1
37056
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
37057
+  (0.0ms) begin transaction
37058
+ SQL (0.2ms) UPDATE "users" SET "tokens" = ?, "updated_at" = ? WHERE "users"."id" = 1 [["tokens", "{\"w_an0weNUDKhTtD2swV-0w\":{\"token\":\"$2a$10$TuXDtuTVo7j9SgjGrpFfheb883mJm.o.NfK2WRf4tBnUyqG8VaoaS\",\"expiry\":1406673401,\"last_token\":\"$2a$10$H/aacu1zhX7sPIZLrcBJf.L6AMZIEpWK3Y3.WWEbISi4br5Y/oQbi\",\"updated_at\":\"2014-07-15 17:36:41 -0500\"},\"JpkotX_5GMZTxCA3Kr6LSg\":{\"token\":\"$2a$10$xLT6URzVbql5Avfp5mNlpu.GNFju.QdYhSCMQmF/0eC8LNGoxS5MW\",\"expiry\":1406767570,\"last_token\":\"$2a$10$pBPj.THu5cDlfWqmbcUt9uXw9oEjtvq1/GtXQtk7CbW68YSivSfvW\",\"updated_at\":\"2014-07-16 19:46:15 -0500\"},\"506KuB-C-2mKsW6PO5BHCg\":{\"token\":\"$2a$10$ltjKp73qzSd2h.YPgdFHWO/ZT68yJzOMt3W2oqJu3JwwQuvrwG46W\",\"expiry\":1406767597,\"last_token\":\"$2a$10$0mxS.YawQiGPNWLXvXHqzu.SzA9R2vEjXc1UvD6Jl1rhJOq7IC.ii\",\"updated_at\":\"2014-07-16 19:46:37 -0500\"},\"D5CEgvw0vNDrg9YW4spS_g\":{\"token\":\"$2a$10$l0KoYQNx95TDUNrVg84Q3OpXyrCRajgW.Q4VABwYOQhsvFwfCuYS2\",\"expiry\":1406778820,\"last_token\":\"$2a$10$YxRLETQUHNcrSe4NCfp36esWrmy3d5Fqij9N76xRzTu1Ql1COPYVa\",\"updated_at\":\"2014-07-16 22:53:44 -0500\"}}"], ["updated_at", "2014-07-17 03:53:47.593975"]]
37059
+  (1.7ms) commit transaction
37060
+  (0.1ms) begin transaction
37061
+ SQL (0.2ms) UPDATE "users" SET "tokens" = ?, "updated_at" = ? WHERE "users"."id" = 1 [["tokens", "{\"w_an0weNUDKhTtD2swV-0w\":{\"token\":\"$2a$10$TuXDtuTVo7j9SgjGrpFfheb883mJm.o.NfK2WRf4tBnUyqG8VaoaS\",\"expiry\":1406673401,\"last_token\":\"$2a$10$H/aacu1zhX7sPIZLrcBJf.L6AMZIEpWK3Y3.WWEbISi4br5Y/oQbi\",\"updated_at\":\"2014-07-15 17:36:41 -0500\"},\"JpkotX_5GMZTxCA3Kr6LSg\":{\"token\":\"$2a$10$xLT6URzVbql5Avfp5mNlpu.GNFju.QdYhSCMQmF/0eC8LNGoxS5MW\",\"expiry\":1406767570,\"last_token\":\"$2a$10$pBPj.THu5cDlfWqmbcUt9uXw9oEjtvq1/GtXQtk7CbW68YSivSfvW\",\"updated_at\":\"2014-07-16 19:46:15 -0500\"},\"506KuB-C-2mKsW6PO5BHCg\":{\"token\":\"$2a$10$ltjKp73qzSd2h.YPgdFHWO/ZT68yJzOMt3W2oqJu3JwwQuvrwG46W\",\"expiry\":1406767597,\"last_token\":\"$2a$10$0mxS.YawQiGPNWLXvXHqzu.SzA9R2vEjXc1UvD6Jl1rhJOq7IC.ii\",\"updated_at\":\"2014-07-16 19:46:37 -0500\"},\"D5CEgvw0vNDrg9YW4spS_g\":{\"token\":\"$2a$10$l0KoYQNx95TDUNrVg84Q3OpXyrCRajgW.Q4VABwYOQhsvFwfCuYS2\",\"expiry\":1406778820,\"last_token\":\"$2a$10$YxRLETQUHNcrSe4NCfp36esWrmy3d5Fqij9N76xRzTu1Ql1COPYVa\",\"updated_at\":\"2014-07-16 22:53:47 -0500\"}}"], ["updated_at", "2014-07-17 03:53:47.597826"]]
37062
+  (0.7ms) commit transaction
37063
+ Completed 200 OK in 69ms (Views: 0.2ms | ActiveRecord: 3.3ms)
37064
+
37065
+
37066
+ Started GET "/auth/facebook?auth_origin_url=http://ng-token-auth.dev/" for 127.0.0.1 at 2014-07-16 22:53:50 -0500
37067
+
37068
+
37069
+ Started GET "/omniauth/facebook?auth_origin_url=http%3A%2F%2Fng-token-auth.dev%2F&resource_class=User" for 127.0.0.1 at 2014-07-16 22:53:50 -0500
37070
+
37071
+
37072
+ Started GET "/auth/developer?auth_origin_url=http://ng-token-auth.dev/" for 127.0.0.1 at 2014-07-16 22:53:53 -0500
37073
+
37074
+
37075
+ Started GET "/omniauth/developer?auth_origin_url=http%3A%2F%2Fng-token-auth.dev%2F&resource_class=User" for 127.0.0.1 at 2014-07-16 22:53:53 -0500
37076
+
37077
+
37078
+ Started POST "/omniauth/developer/callback" for 127.0.0.1 at 2014-07-16 22:54:00 -0500
37079
+
37080
+ ActionController::RoutingError (No route matches [POST] "/omniauth/developer/callback"):
37081
+ actionpack (4.1.4) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
37082
+ actionpack (4.1.4) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
37083
+ railties (4.1.4) lib/rails/rack/logger.rb:38:in `call_app'
37084
+ railties (4.1.4) lib/rails/rack/logger.rb:20:in `block in call'
37085
+ activesupport (4.1.4) lib/active_support/tagged_logging.rb:68:in `block in tagged'
37086
+ activesupport (4.1.4) lib/active_support/tagged_logging.rb:26:in `tagged'
37087
+ activesupport (4.1.4) lib/active_support/tagged_logging.rb:68:in `tagged'
37088
+ railties (4.1.4) lib/rails/rack/logger.rb:20:in `call'
37089
+ actionpack (4.1.4) lib/action_dispatch/middleware/request_id.rb:21:in `call'
37090
+ rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
37091
+ rack (1.5.2) lib/rack/runtime.rb:17:in `call'
37092
+ activesupport (4.1.4) lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call'
37093
+ rack (1.5.2) lib/rack/lock.rb:17:in `call'
37094
+ actionpack (4.1.4) lib/action_dispatch/middleware/static.rb:64:in `call'
37095
+ rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
37096
+ railties (4.1.4) lib/rails/engine.rb:514:in `call'
37097
+ railties (4.1.4) lib/rails/application.rb:144:in `call'
37098
+ /Users/lynnhurley/Library/Application Support/Pow/Versions/0.4.3/node_modules/nack/lib/nack/server.rb:155:in `handle'
37099
+ /Users/lynnhurley/Library/Application Support/Pow/Versions/0.4.3/node_modules/nack/lib/nack/server.rb:109:in `rescue in block (2 levels) in start'
37100
+ /Users/lynnhurley/Library/Application Support/Pow/Versions/0.4.3/node_modules/nack/lib/nack/server.rb:106:in `block (2 levels) in start'
37101
+ /Users/lynnhurley/Library/Application Support/Pow/Versions/0.4.3/node_modules/nack/lib/nack/server.rb:96:in `each'
37102
+ /Users/lynnhurley/Library/Application Support/Pow/Versions/0.4.3/node_modules/nack/lib/nack/server.rb:96:in `block in start'
37103
+ /Users/lynnhurley/Library/Application Support/Pow/Versions/0.4.3/node_modules/nack/lib/nack/server.rb:76:in `loop'
37104
+ /Users/lynnhurley/Library/Application Support/Pow/Versions/0.4.3/node_modules/nack/lib/nack/server.rb:76:in `start'
37105
+ /Users/lynnhurley/Library/Application Support/Pow/Versions/0.4.3/node_modules/nack/lib/nack/server.rb:12:in `run'
37106
+ /Users/lynnhurley/Library/Application Support/Pow/Versions/0.4.3/node_modules/nack/bin/nack_worker:4:in `<main>'
37107
+
37108
+
37109
+ Rendered /opt/rubies/2.1.1/lib/ruby/gems/2.1.0/gems/actionpack-4.1.4/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (0.9ms)
37110
+ Rendered /opt/rubies/2.1.1/lib/ruby/gems/2.1.0/gems/actionpack-4.1.4/lib/action_dispatch/middleware/templates/routes/_route.html.erb (3.8ms)
37111
+ Rendered /opt/rubies/2.1.1/lib/ruby/gems/2.1.0/gems/actionpack-4.1.4/lib/action_dispatch/middleware/templates/routes/_table.html.erb (6.1ms)
37112
+ Rendered /opt/rubies/2.1.1/lib/ruby/gems/2.1.0/gems/actionpack-4.1.4/lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb within rescues/layout (48.0ms)
37113
+
37114
+
37115
+ Started GET "/" for 127.0.0.1 at 2014-07-16 23:43:42 -0500
37116
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
37117
+ Processing by Rails::WelcomeController#index as HTML
37118
+ Rendered /opt/rubies/2.1.1/lib/ruby/gems/2.1.0/gems/railties-4.1.4/lib/rails/templates/rails/welcome/index.html.erb (1.6ms)
37119
+ Completed 200 OK in 7ms (Views: 6.5ms | ActiveRecord: 0.0ms)
37120
+
37121
+
37122
+ Started GET "/" for 127.0.0.1 at 2014-07-17 18:37:26 -0500
37123
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
37124
+ Processing by Rails::WelcomeController#index as HTML
37125
+ Rendered /opt/rubies/2.1.1/lib/ruby/gems/2.1.0/gems/railties-4.1.4/lib/rails/templates/rails/welcome/index.html.erb (2.0ms)
37126
+ Completed 200 OK in 11ms (Views: 10.8ms | ActiveRecord: 0.0ms)