devise_token_auth 0.1.13 → 0.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,135 @@
1
+ require 'test_helper'
2
+
3
+ # was the web request successful?
4
+ # was the user redirected to the right page?
5
+ # was the user successfully authenticated?
6
+ # was the correct object stored in the response?
7
+ # was the appropriate message delivered in the json payload?
8
+
9
+ class DeviseTokenAuth::RegistrationsControllerTest < ActionController::TestCase
10
+ describe DeviseTokenAuth::RegistrationsController, "Successful registration" do
11
+ before do
12
+ xhr :post, :create, {
13
+ email: -> { Faker::Internet.email },
14
+ password: "secret123",
15
+ password_confirmation: "secret123",
16
+ confirm_success_url: -> { Faker::Internet.url }
17
+ }
18
+
19
+ @user = assigns(:resource)
20
+ @data = JSON.parse(response.body)
21
+ @mail = ActionMailer::Base.deliveries.last
22
+ end
23
+
24
+ test "request should be successful" do
25
+ assert_equal 200, response.status
26
+ end
27
+
28
+ test "user should have been created" do
29
+ assert @user.id
30
+ end
31
+
32
+ test "user should not be confirmed" do
33
+ assert_nil @user.confirmed_at
34
+ end
35
+
36
+ test "new user data should be returned as json" do
37
+ assert @data['data']['email']
38
+ end
39
+
40
+ test "new user should receive confirmation email" do
41
+ assert_equal @user.email, @mail['to'].to_s
42
+ end
43
+
44
+ test "new user password should not be returned" do
45
+ assert_nil @data['data']['password']
46
+ end
47
+ end
48
+
49
+ describe DeviseTokenAuth::RegistrationsController, "Mismatched passwords" do
50
+ before do
51
+ xhr :post, :create, {
52
+ email: -> { Faker::Internet.email },
53
+ password: "secret123",
54
+ password_confirmation: "bogus",
55
+ confirm_success_url: -> { Faker::Internet.url }
56
+ }
57
+
58
+ @user = assigns(:resource)
59
+ @data = JSON.parse(response.body)
60
+ end
61
+
62
+ test "request should not be successful" do
63
+ assert_equal 403, response.status
64
+ end
65
+
66
+ test "user should have been created" do
67
+ assert_nil @user.id
68
+ end
69
+
70
+ test "error should be returned in the response" do
71
+ assert @data['errors'].length
72
+ end
73
+ end
74
+
75
+ describe DeviseTokenAuth::RegistrationsController, "Existing users" do
76
+ fixtures :users
77
+
78
+ before do
79
+ @existing_user = users(:confirmed_email_user)
80
+
81
+ xhr :post, :create, {
82
+ email: @existing_user.email,
83
+ password: "secret123",
84
+ password_confirmation: "secret123",
85
+ confirm_success_url: -> { Faker::Internet.url }
86
+ }
87
+
88
+ @user = assigns(:resource)
89
+ @data = JSON.parse(response.body)
90
+ end
91
+
92
+ test "request should not be successful" do
93
+ assert_equal 403, response.status
94
+ end
95
+
96
+ test "user should have been created" do
97
+ assert_nil @user.id
98
+ end
99
+
100
+ test "error should be returned in the response" do
101
+ assert @data['errors'].length
102
+ end
103
+ end
104
+
105
+
106
+ describe DeviseTokenAuth::RegistrationsController, "Ouath user has existing email" do
107
+ fixtures :users
108
+
109
+ before do
110
+ @existing_user = users(:duplicate_email_facebook_user)
111
+
112
+ xhr :post, :create, {
113
+ email: @existing_user.email,
114
+ password: "secret123",
115
+ password_confirmation: "secret123",
116
+ confirm_success_url: -> { Faker::Internet.url }
117
+ }
118
+
119
+ @user = assigns(:resource)
120
+ @data = JSON.parse(response.body)
121
+ end
122
+
123
+ test "request should be successful" do
124
+ assert_equal 200, response.status
125
+ end
126
+
127
+ test "user should have been created" do
128
+ assert @user.id
129
+ end
130
+
131
+ test "new user data should be returned as json" do
132
+ assert @data['data']['email']
133
+ end
134
+ end
135
+ end
@@ -0,0 +1,96 @@
1
+ require 'test_helper'
2
+
3
+ # was the web request successful?
4
+ # was the user redirected to the right page?
5
+ # was the user successfully authenticated?
6
+ # was the correct object stored in the response?
7
+ # was the appropriate message delivered in the json payload?
8
+
9
+ class DeviseTokenAuth::SessionsControllerTest < ActionController::TestCase
10
+ describe DeviseTokenAuth::SessionsController, "Confirmed user" do
11
+ before do
12
+ @existing_user = users(:confirmed_email_user)
13
+ @existing_user.skip_confirmation!
14
+ @existing_user.save!
15
+ end
16
+
17
+ describe 'success' do
18
+ before do
19
+ xhr :post, :create, {
20
+ email: @existing_user.email,
21
+ password: 'secret123'
22
+ }
23
+
24
+ @user = assigns(:user)
25
+ @data = JSON.parse(response.body)
26
+ end
27
+
28
+ test "request should succeed" do
29
+ assert_equal 200, response.status
30
+ end
31
+
32
+ test "request should return user data" do
33
+ assert_equal @existing_user.email, @data['data']['email']
34
+ end
35
+ end
36
+
37
+ describe 'failure' do
38
+ before do
39
+ xhr :post, :create, {
40
+ email: @existing_user.email,
41
+ password: 'bogus'
42
+ }
43
+
44
+ @user = assigns(:user)
45
+ @data = JSON.parse(response.body)
46
+ end
47
+
48
+ test "request should fail" do
49
+ assert_equal 401, response.status
50
+ end
51
+
52
+ test "response should contain errors" do
53
+ assert @data['errors']
54
+ end
55
+ end
56
+ end
57
+
58
+ describe DeviseTokenAuth::SessionsController, "Unconfirmed user" do
59
+ before do
60
+ @unconfirmed_user = users(:unconfirmed_email_user)
61
+ xhr :post, :create, {
62
+ email: @unconfirmed_user.email,
63
+ password: 'secret123'
64
+ }
65
+ @user = assigns(:user)
66
+ @data = JSON.parse(response.body)
67
+ end
68
+
69
+ test "request should fail" do
70
+ assert_equal 401, response.status
71
+ end
72
+
73
+ test "response should contain errors" do
74
+ assert @data['errors']
75
+ end
76
+ end
77
+
78
+ describe DeviseTokenAuth::SessionsController, "Non-existing user" do
79
+ before do
80
+ xhr :post, :create, {
81
+ email: -> { Faker::Internet.email },
82
+ password: -> { Faker::Number.number(10) }
83
+ }
84
+ @user = assigns(:user)
85
+ @data = JSON.parse(response.body)
86
+ end
87
+
88
+ test "request should fail" do
89
+ assert_equal 401, response.status
90
+ end
91
+
92
+ test "response should contain errors" do
93
+ assert @data['errors']
94
+ end
95
+ end
96
+ end
data/test/dummy/bin/rails CHANGED
@@ -1,4 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
+ begin
3
+ load File.expand_path("../spring", __FILE__)
4
+ rescue LoadError
5
+ end
2
6
  APP_PATH = File.expand_path('../../config/application', __FILE__)
3
7
  require_relative '../config/boot'
4
8
  require 'rails/commands'
data/test/dummy/bin/rake CHANGED
@@ -1,4 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
+ begin
3
+ load File.expand_path("../spring", __FILE__)
4
+ rescue LoadError
5
+ end
2
6
  require_relative '../config/boot'
3
7
  require 'rake'
4
8
  Rake.application.run
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # This file loads spring without using Bundler, in order to be fast
4
+ # It gets overwritten when you run the `spring binstub` command
5
+
6
+ unless defined?(Spring)
7
+ require "rubygems"
8
+ require "bundler"
9
+
10
+ if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ spring \((.*?)\)$.*?^$/m)
11
+ ENV["GEM_PATH"] = ([Bundler.bundle_path.to_s] + Gem.path).join(File::PATH_SEPARATOR)
12
+ ENV["GEM_HOME"] = ""
13
+ Gem.paths = ENV
14
+
15
+ gem "spring", match[1]
16
+ require "spring/binstub"
17
+ end
18
+ end
@@ -30,6 +30,7 @@ Rails.application.configure do
30
30
  # The :test delivery method accumulates sent emails in the
31
31
  # ActionMailer::Base.deliveries array.
32
32
  config.action_mailer.delivery_method = :test
33
+ config.action_mailer.default_url_options = { :host => 'localhost' }
33
34
 
34
35
  # Print deprecation notices to the stderr.
35
36
  config.active_support.deprecation = :stderr
Binary file
Binary file
@@ -12042,3 +12042,335 @@ Unpermitted parameters: registration
12042
12042
  User Exists (0.1ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = 'lynn.dylan.hurley@gmail.com' AND "users"."provider" = 'email' LIMIT 1
12043
12043
   (0.1ms) rollback transaction
12044
12044
  Completed 403 Forbidden in 69ms (Views: 0.3ms | ActiveRecord: 0.3ms)
12045
+
12046
+
12047
+ Started GET "/auth/github" for 127.0.0.1 at 2014-07-06 19:21:35 -0500
12048
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
12049
+
12050
+
12051
+ Started GET "/auth/github/callback?code=300aa4b81ecdbfd8dd72&state=0bcd80bdebaea524e15dc2f00b6d6e4c9b75c7157556d703" for 127.0.0.1 at 2014-07-06 19:21:35 -0500
12052
+ Processing by DeviseTokenAuth::AuthController#omniauth_success as HTML
12053
+ Parameters: {"code"=>"300aa4b81ecdbfd8dd72", "state"=>"0bcd80bdebaea524e15dc2f00b6d6e4c9b75c7157556d703", "provider"=>"github"}
12054
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = '468037' AND "users"."provider" = 'github' ORDER BY "users"."id" ASC LIMIT 1
12055
+  (0.1ms) begin transaction
12056
+ User Exists (0.1ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = 'lynn.dylan.hurley+github@gmail.com' AND "users"."provider" = 'email' LIMIT 1
12057
+ Binary data inserted for `string` type on column `encrypted_password`
12058
+ SQL (0.4ms) INSERT INTO "users" ("confirmed_at", "created_at", "email", "encrypted_password", "image", "name", "nickname", "provider", "tokens", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["confirmed_at", "2014-07-07 00:21:36.608919"], ["created_at", "2014-07-07 00:21:36.620017"], ["email", "lynn.dylan.hurley+github@gmail.com"], ["encrypted_password", "$2a$10$LPa3JR1.Hy.B0ER4hsOLNuhdyRuO28Q6H3YcABk2hMSBgHlPpi3La"], ["image", "https://avatars.githubusercontent.com/u/468037?"], ["name", "Lynn Dylan Hurley"], ["nickname", "lynndylanhurley"], ["provider", "github"], ["tokens", "{\"0ZxOFh9BIw4-O9-Pz3U75w\":{\"token\":\"$2a$10$MQdAwKdfS4LxVnEr7io9iuEyPKPs9Hj9/lpaPq5jgcjHaY97NdyyS\",\"expiry\":\"2014-07-20 19:21:36 -0500\"}}"], ["uid", "468037"], ["updated_at", "2014-07-07 00:21:36.620017"]]
12059
+  (1.9ms) commit transaction
12060
+ Rendered /Users/lynnhurley/Code/Auth/devise_token_auth/app/views/devise_token_auth/omniauth_success.html.erb within layouts/omniauth_response (1.5ms)
12061
+ Completed 200 OK in 163ms (Views: 7.9ms | ActiveRecord: 3.0ms)
12062
+
12063
+
12064
+ Started OPTIONS "/auth/sign_out" for 127.0.0.1 at 2014-07-06 19:21:41 -0500
12065
+
12066
+
12067
+ Started DELETE "/auth/sign_out" for 127.0.0.1 at 2014-07-06 19:21:41 -0500
12068
+ Processing by DeviseTokenAuth::SessionsController#destroy as HTML
12069
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = '468037' LIMIT 1
12070
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 4 ORDER BY "users"."id" ASC LIMIT 1
12071
+  (0.1ms) begin transaction
12072
+ SQL (0.4ms) UPDATE "users" SET "tokens" = ?, "updated_at" = ? WHERE "users"."id" = 4 [["tokens", "{\"0ZxOFh9BIw4-O9-Pz3U75w\":{\"token\":\"$2a$10$MQdAwKdfS4LxVnEr7io9iuEyPKPs9Hj9/lpaPq5jgcjHaY97NdyyS\",\"expiry\":\"2014-07-20 19:21:36 -0500\"}}"], ["updated_at", "2014-07-07 00:21:41.357695"]]
12073
+  (0.5ms) commit transaction
12074
+  (0.1ms) begin transaction
12075
+ User Exists (0.1ms) SELECT 1 AS one FROM "users" WHERE ("users"."email" = 'lynn.dylan.hurley+github@gmail.com' AND "users"."id" != 4) AND "users"."provider" = 'email' LIMIT 1
12076
+ SQL (0.2ms) UPDATE "users" SET "tokens" = ?, "updated_at" = ? WHERE "users"."id" = 4 [["tokens", "{\"0ZxOFh9BIw4-O9-Pz3U75w\":{\"token\":\"$2a$10$gHPXI3FkgF78TpdfTmxnb.leB99RQWCEdK69pVeMmq5L4.uoMh7ay\",\"expiry\":\"2014-07-20 19:21:41 -0500\"}}"], ["updated_at", "2014-07-07 00:21:41.421942"]]
12077
+  (0.6ms) commit transaction
12078
+ Completed 200 OK in 134ms (Views: 0.2ms | ActiveRecord: 2.3ms)
12079
+
12080
+
12081
+ Started GET "/auth/google_oauth2" for 127.0.0.1 at 2014-07-06 19:39:07 -0500
12082
+
12083
+
12084
+ Started GET "/auth/google_oauth2/callback?state=d34ce3da378f289cae37367ae45d2dcd5a2e672a77056638&code=4/4RCwyOjGgFEyHe_h8KIzZ6WBYIT0.QqO0n8B7mdAVmmS0T3UFEsMul4gcjgI" for 127.0.0.1 at 2014-07-06 19:39:07 -0500
12085
+ Processing by DeviseTokenAuth::AuthController#omniauth_success as HTML
12086
+ Parameters: {"state"=>"d34ce3da378f289cae37367ae45d2dcd5a2e672a77056638", "code"=>"4/4RCwyOjGgFEyHe_h8KIzZ6WBYIT0.QqO0n8B7mdAVmmS0T3UFEsMul4gcjgI", "provider"=>"google_oauth2"}
12087
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = '110417483437532545267' AND "users"."provider" = 'google_oauth2' ORDER BY "users"."id" ASC LIMIT 1
12088
+  (0.1ms) begin transaction
12089
+ User Exists (0.1ms) SELECT 1 AS one FROM "users" WHERE ("users"."email" = 'lynn.dylan.hurley@gmail.com' AND "users"."id" != 1) AND "users"."provider" = 'email' LIMIT 1
12090
+  (0.1ms) rollback transaction
12091
+ Completed 422 Unprocessable Entity in 70ms
12092
+
12093
+ ActiveRecord::RecordInvalid (Validation failed: Email has already been taken):
12094
+ activerecord (4.1.2) lib/active_record/validations.rb:57:in `save!'
12095
+ activerecord (4.1.2) lib/active_record/attribute_methods/dirty.rb:29:in `save!'
12096
+ activerecord (4.1.2) lib/active_record/transactions.rb:273:in `block in save!'
12097
+ activerecord (4.1.2) lib/active_record/transactions.rb:329:in `block in with_transaction_returning_status'
12098
+ activerecord (4.1.2) lib/active_record/connection_adapters/abstract/database_statements.rb:201:in `block in transaction'
12099
+ activerecord (4.1.2) lib/active_record/connection_adapters/abstract/database_statements.rb:209:in `within_new_transaction'
12100
+ activerecord (4.1.2) lib/active_record/connection_adapters/abstract/database_statements.rb:201:in `transaction'
12101
+ activerecord (4.1.2) lib/active_record/transactions.rb:208:in `transaction'
12102
+ activerecord (4.1.2) lib/active_record/transactions.rb:326:in `with_transaction_returning_status'
12103
+ activerecord (4.1.2) lib/active_record/transactions.rb:273:in `save!'
12104
+ /Users/lynnhurley/Code/Auth/devise_token_auth/app/controllers/devise_token_auth/auth_controller.rb:56:in `omniauth_success'
12105
+ actionpack (4.1.2) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
12106
+ actionpack (4.1.2) lib/abstract_controller/base.rb:189:in `process_action'
12107
+ actionpack (4.1.2) lib/action_controller/metal/rendering.rb:10:in `process_action'
12108
+ actionpack (4.1.2) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
12109
+ activesupport (4.1.2) lib/active_support/callbacks.rb:113:in `call'
12110
+ activesupport (4.1.2) lib/active_support/callbacks.rb:113:in `call'
12111
+ activesupport (4.1.2) lib/active_support/callbacks.rb:215:in `block in halting_and_conditional'
12112
+ activesupport (4.1.2) lib/active_support/callbacks.rb:166:in `call'
12113
+ activesupport (4.1.2) lib/active_support/callbacks.rb:166:in `block in halting'
12114
+ activesupport (4.1.2) lib/active_support/callbacks.rb:86:in `call'
12115
+ activesupport (4.1.2) lib/active_support/callbacks.rb:86:in `run_callbacks'
12116
+ actionpack (4.1.2) lib/abstract_controller/callbacks.rb:19:in `process_action'
12117
+ actionpack (4.1.2) lib/action_controller/metal/rescue.rb:29:in `process_action'
12118
+ actionpack (4.1.2) lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
12119
+ activesupport (4.1.2) lib/active_support/notifications.rb:159:in `block in instrument'
12120
+ activesupport (4.1.2) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
12121
+ activesupport (4.1.2) lib/active_support/notifications.rb:159:in `instrument'
12122
+ actionpack (4.1.2) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
12123
+ actionpack (4.1.2) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
12124
+ activerecord (4.1.2) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
12125
+ actionpack (4.1.2) lib/abstract_controller/base.rb:136:in `process'
12126
+ actionview (4.1.2) lib/action_view/rendering.rb:30:in `process'
12127
+ actionpack (4.1.2) lib/action_controller/metal.rb:196:in `dispatch'
12128
+ actionpack (4.1.2) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
12129
+ actionpack (4.1.2) lib/action_controller/metal.rb:232:in `block in action'
12130
+ actionpack (4.1.2) lib/action_dispatch/routing/route_set.rb:82:in `call'
12131
+ actionpack (4.1.2) lib/action_dispatch/routing/route_set.rb:82:in `dispatch'
12132
+ actionpack (4.1.2) lib/action_dispatch/routing/route_set.rb:50:in `call'
12133
+ actionpack (4.1.2) lib/action_dispatch/journey/router.rb:71:in `block in call'
12134
+ actionpack (4.1.2) lib/action_dispatch/journey/router.rb:59:in `each'
12135
+ actionpack (4.1.2) lib/action_dispatch/journey/router.rb:59:in `call'
12136
+ actionpack (4.1.2) lib/action_dispatch/routing/route_set.rb:678:in `call'
12137
+ railties (4.1.2) lib/rails/engine.rb:514:in `call'
12138
+ railties (4.1.2) lib/rails/railtie.rb:194:in `public_send'
12139
+ railties (4.1.2) lib/rails/railtie.rb:194:in `method_missing'
12140
+ actionpack (4.1.2) lib/action_dispatch/journey/router.rb:71:in `block in call'
12141
+ actionpack (4.1.2) lib/action_dispatch/journey/router.rb:59:in `each'
12142
+ actionpack (4.1.2) lib/action_dispatch/journey/router.rb:59:in `call'
12143
+ actionpack (4.1.2) lib/action_dispatch/routing/route_set.rb:678:in `call'
12144
+ omniauth (1.2.1) lib/omniauth/strategy.rb:404:in `call_app!'
12145
+ omniauth (1.2.1) lib/omniauth/strategy.rb:362:in `callback_phase'
12146
+ omniauth-oauth2 (1.1.2) lib/omniauth/strategies/oauth2.rb:77:in `callback_phase'
12147
+ omniauth (1.2.1) lib/omniauth/strategy.rb:227:in `callback_call'
12148
+ omniauth (1.2.1) lib/omniauth/strategy.rb:184:in `call!'
12149
+ omniauth (1.2.1) lib/omniauth/strategy.rb:164:in `call'
12150
+ omniauth (1.2.1) lib/omniauth/strategy.rb:186:in `call!'
12151
+ omniauth (1.2.1) lib/omniauth/strategy.rb:164:in `call'
12152
+ omniauth (1.2.1) lib/omniauth/strategy.rb:186:in `call!'
12153
+ omniauth (1.2.1) lib/omniauth/strategy.rb:164:in `call'
12154
+ omniauth (1.2.1) lib/omniauth/builder.rb:59:in `call'
12155
+ rack-cors (0.2.9) lib/rack/cors.rb:54:in `call'
12156
+ warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
12157
+ warden (1.2.3) lib/warden/manager.rb:34:in `catch'
12158
+ warden (1.2.3) lib/warden/manager.rb:34:in `call'
12159
+ rack (1.5.2) lib/rack/etag.rb:23:in `call'
12160
+ rack (1.5.2) lib/rack/conditionalget.rb:25:in `call'
12161
+ rack (1.5.2) lib/rack/head.rb:11:in `call'
12162
+ actionpack (4.1.2) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
12163
+ actionpack (4.1.2) lib/action_dispatch/middleware/flash.rb:254:in `call'
12164
+ rack (1.5.2) lib/rack/session/abstract/id.rb:225:in `context'
12165
+ rack (1.5.2) lib/rack/session/abstract/id.rb:220:in `call'
12166
+ actionpack (4.1.2) lib/action_dispatch/middleware/cookies.rb:560:in `call'
12167
+ activerecord (4.1.2) lib/active_record/query_cache.rb:36:in `call'
12168
+ activerecord (4.1.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:621:in `call'
12169
+ activerecord (4.1.2) lib/active_record/migration.rb:380:in `call'
12170
+ actionpack (4.1.2) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
12171
+ activesupport (4.1.2) lib/active_support/callbacks.rb:82:in `run_callbacks'
12172
+ actionpack (4.1.2) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
12173
+ actionpack (4.1.2) lib/action_dispatch/middleware/reloader.rb:73:in `call'
12174
+ actionpack (4.1.2) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
12175
+ actionpack (4.1.2) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
12176
+ actionpack (4.1.2) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
12177
+ railties (4.1.2) lib/rails/rack/logger.rb:38:in `call_app'
12178
+ railties (4.1.2) lib/rails/rack/logger.rb:20:in `block in call'
12179
+ activesupport (4.1.2) lib/active_support/tagged_logging.rb:68:in `block in tagged'
12180
+ activesupport (4.1.2) lib/active_support/tagged_logging.rb:26:in `tagged'
12181
+ activesupport (4.1.2) lib/active_support/tagged_logging.rb:68:in `tagged'
12182
+ railties (4.1.2) lib/rails/rack/logger.rb:20:in `call'
12183
+ actionpack (4.1.2) lib/action_dispatch/middleware/request_id.rb:21:in `call'
12184
+ rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
12185
+ rack (1.5.2) lib/rack/runtime.rb:17:in `call'
12186
+ activesupport (4.1.2) lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call'
12187
+ rack (1.5.2) lib/rack/lock.rb:17:in `call'
12188
+ actionpack (4.1.2) lib/action_dispatch/middleware/static.rb:64:in `call'
12189
+ rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
12190
+ railties (4.1.2) lib/rails/engine.rb:514:in `call'
12191
+ railties (4.1.2) lib/rails/application.rb:144:in `call'
12192
+ rack (1.5.2) lib/rack/lock.rb:17:in `call'
12193
+ rack (1.5.2) lib/rack/content_length.rb:14:in `call'
12194
+ rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service'
12195
+ /opt/rubies/2.1.1/lib/ruby/2.1.0/webrick/httpserver.rb:138:in `service'
12196
+ /opt/rubies/2.1.1/lib/ruby/2.1.0/webrick/httpserver.rb:94:in `run'
12197
+ /opt/rubies/2.1.1/lib/ruby/2.1.0/webrick/server.rb:295:in `block in start_thread'
12198
+
12199
+
12200
+ Rendered /opt/rubies/2.1.1/lib/ruby/gems/2.1.0/gems/actionpack-4.1.2/lib/action_dispatch/middleware/templates/rescues/_source.erb (0.4ms)
12201
+ Rendered /opt/rubies/2.1.1/lib/ruby/gems/2.1.0/gems/actionpack-4.1.2/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (1.0ms)
12202
+ Rendered /opt/rubies/2.1.1/lib/ruby/gems/2.1.0/gems/actionpack-4.1.2/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (0.8ms)
12203
+ Rendered /opt/rubies/2.1.1/lib/ruby/gems/2.1.0/gems/actionpack-4.1.2/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (9.5ms)
12204
+
12205
+
12206
+ Started GET "/auth/github" for 127.0.0.1 at 2014-07-06 19:39:24 -0500
12207
+
12208
+
12209
+ Started GET "/auth/github/callback?code=8eea84f5594eab964218&state=f146a3406599d0eca5c1414cba044d2e30ac0f8382fc856b" for 127.0.0.1 at 2014-07-06 19:39:24 -0500
12210
+ Processing by DeviseTokenAuth::AuthController#omniauth_success as HTML
12211
+ Parameters: {"code"=>"8eea84f5594eab964218", "state"=>"f146a3406599d0eca5c1414cba044d2e30ac0f8382fc856b", "provider"=>"github"}
12212
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = '468037' AND "users"."provider" = 'github' ORDER BY "users"."id" ASC LIMIT 1
12213
+  (0.1ms) begin transaction
12214
+ User Exists (0.1ms) SELECT 1 AS one FROM "users" WHERE ("users"."email" = 'lynn.dylan.hurley+github@gmail.com' AND "users"."id" != 4) AND "users"."provider" = 'email' LIMIT 1
12215
+ SQL (0.2ms) UPDATE "users" SET "confirmed_at" = ?, "tokens" = ?, "updated_at" = ? WHERE "users"."id" = 4 [["confirmed_at", "2014-07-07 00:39:25.244810"], ["tokens", "{\"0ZxOFh9BIw4-O9-Pz3U75w\":{\"token\":\"$2a$10$gHPXI3FkgF78TpdfTmxnb.leB99RQWCEdK69pVeMmq5L4.uoMh7ay\",\"expiry\":\"2014-07-20 19:21:41 -0500\"},\"d2FV5CnOeJ4k-38ldtRkUQ\":{\"token\":\"$2a$10$62L59pOxU9UfV/IDCpe4u.AbWDKrwrrhpx1QPR2PNbpGEQIZKhNSC\",\"expiry\":\"2014-07-20 19:39:25 -0500\"}}"], ["updated_at", "2014-07-07 00:39:25.246058"]]
12216
+  (1.7ms) commit transaction
12217
+ Rendered /Users/lynnhurley/Code/Auth/devise_token_auth/app/views/devise_token_auth/omniauth_success.html.erb within layouts/omniauth_response (0.2ms)
12218
+ Completed 200 OK in 103ms (Views: 2.5ms | ActiveRecord: 2.3ms)
12219
+
12220
+
12221
+ Started OPTIONS "/demo/members_only" for 127.0.0.1 at 2014-07-06 19:39:34 -0500
12222
+
12223
+
12224
+ Started GET "/demo/members_only" for 127.0.0.1 at 2014-07-06 19:39:34 -0500
12225
+ Processing by DemoController#members_only as HTML
12226
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = '468037' LIMIT 1
12227
+  (0.1ms) begin transaction
12228
+ User Exists (0.1ms) SELECT 1 AS one FROM "users" WHERE ("users"."email" = 'lynn.dylan.hurley+github@gmail.com' AND "users"."id" != 4) AND "users"."provider" = 'email' LIMIT 1
12229
+ SQL (0.2ms) UPDATE "users" SET "tokens" = ?, "updated_at" = ? WHERE "users"."id" = 4 [["tokens", "{\"0ZxOFh9BIw4-O9-Pz3U75w\":{\"token\":\"$2a$10$gHPXI3FkgF78TpdfTmxnb.leB99RQWCEdK69pVeMmq5L4.uoMh7ay\",\"expiry\":\"2014-07-20 19:21:41 -0500\"},\"d2FV5CnOeJ4k-38ldtRkUQ\":{\"token\":\"$2a$10$CyX1jtuVEezLC7aKGHI08.vKwcwatfAP.XZMLqXoDFpjPW8Kqo8Vm\",\"expiry\":\"2014-07-20 19:39:34 -0500\"}}"], ["updated_at", "2014-07-07 00:39:34.911050"]]
12230
+  (1.8ms) commit transaction
12231
+ Completed 200 OK in 125ms (Views: 0.6ms | ActiveRecord: 2.4ms)
12232
+
12233
+
12234
+ Started OPTIONS "/auth/sign_out" for 127.0.0.1 at 2014-07-06 19:39:36 -0500
12235
+
12236
+
12237
+ Started DELETE "/auth/sign_out" for 127.0.0.1 at 2014-07-06 19:39:36 -0500
12238
+ Processing by DeviseTokenAuth::SessionsController#destroy as HTML
12239
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = '468037' LIMIT 1
12240
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 4 ORDER BY "users"."id" ASC LIMIT 1
12241
+  (0.0ms) begin transaction
12242
+ SQL (0.3ms) UPDATE "users" SET "tokens" = ?, "updated_at" = ? WHERE "users"."id" = 4 [["tokens", "{\"0ZxOFh9BIw4-O9-Pz3U75w\":{\"token\":\"$2a$10$gHPXI3FkgF78TpdfTmxnb.leB99RQWCEdK69pVeMmq5L4.uoMh7ay\",\"expiry\":\"2014-07-20 19:21:41 -0500\"},\"d2FV5CnOeJ4k-38ldtRkUQ\":{\"token\":\"$2a$10$CyX1jtuVEezLC7aKGHI08.vKwcwatfAP.XZMLqXoDFpjPW8Kqo8Vm\",\"expiry\":\"2014-07-20 19:39:34 -0500\"}}"], ["updated_at", "2014-07-07 00:39:36.890508"]]
12243
+  (1.9ms) commit transaction
12244
+  (0.1ms) begin transaction
12245
+ User Exists (0.1ms) SELECT 1 AS one FROM "users" WHERE ("users"."email" = 'lynn.dylan.hurley+github@gmail.com' AND "users"."id" != 4) AND "users"."provider" = 'email' LIMIT 1
12246
+ SQL (0.2ms) UPDATE "users" SET "tokens" = ?, "updated_at" = ? WHERE "users"."id" = 4 [["tokens", "{\"0ZxOFh9BIw4-O9-Pz3U75w\":{\"token\":\"$2a$10$gHPXI3FkgF78TpdfTmxnb.leB99RQWCEdK69pVeMmq5L4.uoMh7ay\",\"expiry\":\"2014-07-20 19:21:41 -0500\"},\"d2FV5CnOeJ4k-38ldtRkUQ\":{\"token\":\"$2a$10$7vVTz.Va/v.BF/zw6XOlhuwu9jeZJ2NpwEfuCEpfMNEKNbD7SfrXq\",\"expiry\":\"2014-07-20 19:39:36 -0500\"}}"], ["updated_at", "2014-07-07 00:39:36.954680"]]
12247
+  (0.8ms) commit transaction
12248
+ Completed 200 OK in 130ms (Views: 0.2ms | ActiveRecord: 3.7ms)
12249
+
12250
+
12251
+ Started GET "/auth/facebook" for 127.0.0.1 at 2014-07-06 19:39:39 -0500
12252
+
12253
+
12254
+ Started GET "/auth/facebook/callback?code=AQAfy2mNnytvj6w4wrI0kdjLdYegyRXry6mQo_a2lWVxfqxQVNdQX1IPchvIZ2YGyIUqH6ZGdw3HSVqmuKecoXoo6Uj3xARt3KoQlc6XnyUdphNZWJWBnlltwb59ZqFjewVWNMwIwGV6T0pBh_u4Gfvalq3W_NQYg7H07frVcYAQkjWHQfcRGAcLph7iVAjkZju6IRyGrD8PBnOEnZzDySON5Kd2ZkGJOksqzL4kGweQYxmyWsVkc2ZByZBHK1av45E6r79Pz23yjUVRgMdT9tQUk7zsGXaD29FdZpVPGmc8t-Q9xu2bVTIu_at0ZenbAE8&state=b390797cb140a65260dac3e0ed30d3b0b849fca726f063fe" for 127.0.0.1 at 2014-07-06 19:39:39 -0500
12255
+ Processing by DeviseTokenAuth::AuthController#omniauth_success as HTML
12256
+ Parameters: {"code"=>"AQAfy2mNnytvj6w4wrI0kdjLdYegyRXry6mQo_a2lWVxfqxQVNdQX1IPchvIZ2YGyIUqH6ZGdw3HSVqmuKecoXoo6Uj3xARt3KoQlc6XnyUdphNZWJWBnlltwb59ZqFjewVWNMwIwGV6T0pBh_u4Gfvalq3W_NQYg7H07frVcYAQkjWHQfcRGAcLph7iVAjkZju6IRyGrD8PBnOEnZzDySON5Kd2ZkGJOksqzL4kGweQYxmyWsVkc2ZByZBHK1av45E6r79Pz23yjUVRgMdT9tQUk7zsGXaD29FdZpVPGmc8t-Q9xu2bVTIu_at0ZenbAE8", "state"=>"b390797cb140a65260dac3e0ed30d3b0b849fca726f063fe", "provider"=>"facebook"}
12257
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."uid" = '10203213484155274' AND "users"."provider" = 'facebook' ORDER BY "users"."id" ASC LIMIT 1
12258
+  (0.1ms) begin transaction
12259
+ User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE ("users"."email" = 'lynn.dylan.hurley@gmail.com' AND "users"."id" != 2) AND "users"."provider" = 'email' LIMIT 1
12260
+  (0.0ms) rollback transaction
12261
+ Completed 422 Unprocessable Entity in 64ms
12262
+
12263
+ ActiveRecord::RecordInvalid (Validation failed: Email has already been taken):
12264
+ activerecord (4.1.2) lib/active_record/validations.rb:57:in `save!'
12265
+ activerecord (4.1.2) lib/active_record/attribute_methods/dirty.rb:29:in `save!'
12266
+ activerecord (4.1.2) lib/active_record/transactions.rb:273:in `block in save!'
12267
+ activerecord (4.1.2) lib/active_record/transactions.rb:329:in `block in with_transaction_returning_status'
12268
+ activerecord (4.1.2) lib/active_record/connection_adapters/abstract/database_statements.rb:201:in `block in transaction'
12269
+ activerecord (4.1.2) lib/active_record/connection_adapters/abstract/database_statements.rb:209:in `within_new_transaction'
12270
+ activerecord (4.1.2) lib/active_record/connection_adapters/abstract/database_statements.rb:201:in `transaction'
12271
+ activerecord (4.1.2) lib/active_record/transactions.rb:208:in `transaction'
12272
+ activerecord (4.1.2) lib/active_record/transactions.rb:326:in `with_transaction_returning_status'
12273
+ activerecord (4.1.2) lib/active_record/transactions.rb:273:in `save!'
12274
+ /Users/lynnhurley/Code/Auth/devise_token_auth/app/controllers/devise_token_auth/auth_controller.rb:56:in `omniauth_success'
12275
+ actionpack (4.1.2) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
12276
+ actionpack (4.1.2) lib/abstract_controller/base.rb:189:in `process_action'
12277
+ actionpack (4.1.2) lib/action_controller/metal/rendering.rb:10:in `process_action'
12278
+ actionpack (4.1.2) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
12279
+ activesupport (4.1.2) lib/active_support/callbacks.rb:113:in `call'
12280
+ activesupport (4.1.2) lib/active_support/callbacks.rb:113:in `call'
12281
+ activesupport (4.1.2) lib/active_support/callbacks.rb:215:in `block in halting_and_conditional'
12282
+ activesupport (4.1.2) lib/active_support/callbacks.rb:166:in `call'
12283
+ activesupport (4.1.2) lib/active_support/callbacks.rb:166:in `block in halting'
12284
+ activesupport (4.1.2) lib/active_support/callbacks.rb:86:in `call'
12285
+ activesupport (4.1.2) lib/active_support/callbacks.rb:86:in `run_callbacks'
12286
+ actionpack (4.1.2) lib/abstract_controller/callbacks.rb:19:in `process_action'
12287
+ actionpack (4.1.2) lib/action_controller/metal/rescue.rb:29:in `process_action'
12288
+ actionpack (4.1.2) lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
12289
+ activesupport (4.1.2) lib/active_support/notifications.rb:159:in `block in instrument'
12290
+ activesupport (4.1.2) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
12291
+ activesupport (4.1.2) lib/active_support/notifications.rb:159:in `instrument'
12292
+ actionpack (4.1.2) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
12293
+ actionpack (4.1.2) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
12294
+ activerecord (4.1.2) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
12295
+ actionpack (4.1.2) lib/abstract_controller/base.rb:136:in `process'
12296
+ actionview (4.1.2) lib/action_view/rendering.rb:30:in `process'
12297
+ actionpack (4.1.2) lib/action_controller/metal.rb:196:in `dispatch'
12298
+ actionpack (4.1.2) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
12299
+ actionpack (4.1.2) lib/action_controller/metal.rb:232:in `block in action'
12300
+ actionpack (4.1.2) lib/action_dispatch/routing/route_set.rb:82:in `call'
12301
+ actionpack (4.1.2) lib/action_dispatch/routing/route_set.rb:82:in `dispatch'
12302
+ actionpack (4.1.2) lib/action_dispatch/routing/route_set.rb:50:in `call'
12303
+ actionpack (4.1.2) lib/action_dispatch/journey/router.rb:71:in `block in call'
12304
+ actionpack (4.1.2) lib/action_dispatch/journey/router.rb:59:in `each'
12305
+ actionpack (4.1.2) lib/action_dispatch/journey/router.rb:59:in `call'
12306
+ actionpack (4.1.2) lib/action_dispatch/routing/route_set.rb:678:in `call'
12307
+ railties (4.1.2) lib/rails/engine.rb:514:in `call'
12308
+ railties (4.1.2) lib/rails/railtie.rb:194:in `public_send'
12309
+ railties (4.1.2) lib/rails/railtie.rb:194:in `method_missing'
12310
+ actionpack (4.1.2) lib/action_dispatch/journey/router.rb:71:in `block in call'
12311
+ actionpack (4.1.2) lib/action_dispatch/journey/router.rb:59:in `each'
12312
+ actionpack (4.1.2) lib/action_dispatch/journey/router.rb:59:in `call'
12313
+ actionpack (4.1.2) lib/action_dispatch/routing/route_set.rb:678:in `call'
12314
+ omniauth (1.2.1) lib/omniauth/strategy.rb:186:in `call!'
12315
+ omniauth (1.2.1) lib/omniauth/strategy.rb:164:in `call'
12316
+ omniauth (1.2.1) lib/omniauth/strategy.rb:404:in `call_app!'
12317
+ omniauth (1.2.1) lib/omniauth/strategy.rb:362:in `callback_phase'
12318
+ omniauth-oauth2 (1.1.2) lib/omniauth/strategies/oauth2.rb:77:in `callback_phase'
12319
+ /opt/rubies/2.1.1/lib/ruby/gems/2.1.0/bundler/gems/omniauth-facebook-4dbd5f0f40df/lib/omniauth/strategies/facebook.rb:72:in `block in callback_phase'
12320
+ /opt/rubies/2.1.1/lib/ruby/gems/2.1.0/bundler/gems/omniauth-facebook-4dbd5f0f40df/lib/omniauth/strategies/facebook.rb:135:in `with_authorization_code!'
12321
+ /opt/rubies/2.1.1/lib/ruby/gems/2.1.0/bundler/gems/omniauth-facebook-4dbd5f0f40df/lib/omniauth/strategies/facebook.rb:71:in `callback_phase'
12322
+ omniauth (1.2.1) lib/omniauth/strategy.rb:227:in `callback_call'
12323
+ omniauth (1.2.1) lib/omniauth/strategy.rb:184:in `call!'
12324
+ omniauth (1.2.1) lib/omniauth/strategy.rb:164:in `call'
12325
+ omniauth (1.2.1) lib/omniauth/strategy.rb:186:in `call!'
12326
+ omniauth (1.2.1) lib/omniauth/strategy.rb:164:in `call'
12327
+ omniauth (1.2.1) lib/omniauth/builder.rb:59:in `call'
12328
+ rack-cors (0.2.9) lib/rack/cors.rb:54:in `call'
12329
+ warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
12330
+ warden (1.2.3) lib/warden/manager.rb:34:in `catch'
12331
+ warden (1.2.3) lib/warden/manager.rb:34:in `call'
12332
+ rack (1.5.2) lib/rack/etag.rb:23:in `call'
12333
+ rack (1.5.2) lib/rack/conditionalget.rb:25:in `call'
12334
+ rack (1.5.2) lib/rack/head.rb:11:in `call'
12335
+ actionpack (4.1.2) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
12336
+ actionpack (4.1.2) lib/action_dispatch/middleware/flash.rb:254:in `call'
12337
+ rack (1.5.2) lib/rack/session/abstract/id.rb:225:in `context'
12338
+ rack (1.5.2) lib/rack/session/abstract/id.rb:220:in `call'
12339
+ actionpack (4.1.2) lib/action_dispatch/middleware/cookies.rb:560:in `call'
12340
+ activerecord (4.1.2) lib/active_record/query_cache.rb:36:in `call'
12341
+ activerecord (4.1.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:621:in `call'
12342
+ activerecord (4.1.2) lib/active_record/migration.rb:380:in `call'
12343
+ actionpack (4.1.2) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
12344
+ activesupport (4.1.2) lib/active_support/callbacks.rb:82:in `run_callbacks'
12345
+ actionpack (4.1.2) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
12346
+ actionpack (4.1.2) lib/action_dispatch/middleware/reloader.rb:73:in `call'
12347
+ actionpack (4.1.2) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
12348
+ actionpack (4.1.2) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
12349
+ actionpack (4.1.2) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
12350
+ railties (4.1.2) lib/rails/rack/logger.rb:38:in `call_app'
12351
+ railties (4.1.2) lib/rails/rack/logger.rb:20:in `block in call'
12352
+ activesupport (4.1.2) lib/active_support/tagged_logging.rb:68:in `block in tagged'
12353
+ activesupport (4.1.2) lib/active_support/tagged_logging.rb:26:in `tagged'
12354
+ activesupport (4.1.2) lib/active_support/tagged_logging.rb:68:in `tagged'
12355
+ railties (4.1.2) lib/rails/rack/logger.rb:20:in `call'
12356
+ actionpack (4.1.2) lib/action_dispatch/middleware/request_id.rb:21:in `call'
12357
+ rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
12358
+ rack (1.5.2) lib/rack/runtime.rb:17:in `call'
12359
+ activesupport (4.1.2) lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call'
12360
+ rack (1.5.2) lib/rack/lock.rb:17:in `call'
12361
+ actionpack (4.1.2) lib/action_dispatch/middleware/static.rb:64:in `call'
12362
+ rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
12363
+ railties (4.1.2) lib/rails/engine.rb:514:in `call'
12364
+ railties (4.1.2) lib/rails/application.rb:144:in `call'
12365
+ rack (1.5.2) lib/rack/lock.rb:17:in `call'
12366
+ rack (1.5.2) lib/rack/content_length.rb:14:in `call'
12367
+ rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service'
12368
+ /opt/rubies/2.1.1/lib/ruby/2.1.0/webrick/httpserver.rb:138:in `service'
12369
+ /opt/rubies/2.1.1/lib/ruby/2.1.0/webrick/httpserver.rb:94:in `run'
12370
+ /opt/rubies/2.1.1/lib/ruby/2.1.0/webrick/server.rb:295:in `block in start_thread'
12371
+
12372
+
12373
+ Rendered /opt/rubies/2.1.1/lib/ruby/gems/2.1.0/gems/actionpack-4.1.2/lib/action_dispatch/middleware/templates/rescues/_source.erb (0.5ms)
12374
+ Rendered /opt/rubies/2.1.1/lib/ruby/gems/2.1.0/gems/actionpack-4.1.2/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (1.0ms)
12375
+ Rendered /opt/rubies/2.1.1/lib/ruby/gems/2.1.0/gems/actionpack-4.1.2/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (0.8ms)
12376
+ Rendered /opt/rubies/2.1.1/lib/ruby/gems/2.1.0/gems/actionpack-4.1.2/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (9.5ms)