diff --git a/app/controllers/devise_token_auth/concerns/set_user_by_token.rb b/app/controllers/devise_token_auth/concerns/set_user_by_token.rb index d2289a34e..546c76213 100644 --- a/app/controllers/devise_token_auth/concerns/set_user_by_token.rb +++ b/app/controllers/devise_token_auth/concerns/set_user_by_token.rb @@ -106,6 +106,8 @@ def update_auth_header end + sign_out(@resource) + end def resource_class(m=nil) diff --git a/test/dummy/db/schema.rb b/test/dummy/db/schema.rb index b2fc48cdf..b54f5cc68 100644 --- a/test/dummy/db/schema.rb +++ b/test/dummy/db/schema.rb @@ -14,27 +14,27 @@ ActiveRecord::Schema.define(version: 20150708104536) do create_table "evil_users", force: :cascade do |t| - t.string "email", limit: 255 - t.string "encrypted_password", limit: 255, default: "", null: false - t.string "reset_password_token", limit: 255 + t.string "email" + t.string "encrypted_password", default: "", null: false + t.string "reset_password_token" t.datetime "reset_password_sent_at" t.datetime "remember_created_at" - t.integer "sign_in_count", limit: 4, default: 0, null: false + t.integer "sign_in_count", default: 0, null: false t.datetime "current_sign_in_at" t.datetime "last_sign_in_at" - t.string "current_sign_in_ip", limit: 255 - t.string "last_sign_in_ip", limit: 255 - t.string "confirmation_token", limit: 255 + t.string "current_sign_in_ip" + t.string "last_sign_in_ip" + t.string "confirmation_token" t.datetime "confirmed_at" t.datetime "confirmation_sent_at" - t.string "unconfirmed_email", limit: 255 - t.string "name", limit: 255 - t.string "nickname", limit: 255 - t.string "image", limit: 255 - t.string "provider", limit: 255 - t.string "uid", limit: 255, default: "", null: false - t.text "tokens", limit: 65535 - t.string "favorite_color", limit: 255 + t.string "unconfirmed_email" + t.string "name" + t.string "nickname" + t.string "image" + t.string "provider" + t.string "uid", default: "", null: false + t.text "tokens" + t.string "favorite_color" t.datetime "created_at" t.datetime "updated_at" end @@ -45,31 +45,31 @@ add_index "evil_users", ["uid", "provider"], name: "index_evil_users_on_uid_and_provider", unique: true create_table "mangs", force: :cascade do |t| - t.string "email", limit: 255 - t.string "encrypted_password", limit: 255, default: "", null: false - t.string "reset_password_token", limit: 255 + t.string "email" + t.string "encrypted_password", default: "", null: false + t.string "reset_password_token" t.datetime "reset_password_sent_at" - t.string "reset_password_redirect_url", limit: 255 + t.string "reset_password_redirect_url" t.datetime "remember_created_at" - t.integer "sign_in_count", limit: 4, default: 0, null: false + t.integer "sign_in_count", default: 0, null: false t.datetime "current_sign_in_at" t.datetime "last_sign_in_at" - t.string "current_sign_in_ip", limit: 255 - t.string "last_sign_in_ip", limit: 255 - t.string "confirmation_token", limit: 255 + t.string "current_sign_in_ip" + t.string "last_sign_in_ip" + t.string "confirmation_token" t.datetime "confirmed_at" t.datetime "confirmation_sent_at" - t.string "confirm_success_url", limit: 255 - t.string "unconfirmed_email", limit: 255 - t.string "name", limit: 255 - t.string "nickname", limit: 255 - t.string "image", limit: 255 - t.string "provider", limit: 255 - t.string "uid", limit: 255, default: "", null: false - t.text "tokens", limit: 65535 + t.string "confirm_success_url" + t.string "unconfirmed_email" + t.string "name" + t.string "nickname" + t.string "image" + t.string "provider" + t.string "uid", default: "", null: false + t.text "tokens" t.datetime "created_at" t.datetime "updated_at" - t.string "favorite_color", limit: 255 + t.string "favorite_color" end add_index "mangs", ["confirmation_token"], name: "index_mangs_on_confirmation_token", unique: true @@ -107,14 +107,14 @@ add_index "nice_users", ["uid", "provider"], name: "index_nice_users_on_uid_and_provider", unique: true create_table "only_email_users", force: :cascade do |t| - t.string "provider", limit: 255, null: false - t.string "uid", limit: 255, default: "", null: false - t.string "encrypted_password", limit: 255, default: "", null: false - t.string "name", limit: 255 - t.string "nickname", limit: 255 - t.string "image", limit: 255 - t.string "email", limit: 255 - t.text "tokens", limit: 65535 + t.string "provider", null: false + t.string "uid", default: "", null: false + t.string "encrypted_password", default: "", null: false + t.string "name" + t.string "nickname" + t.string "image" + t.string "email" + t.text "tokens" t.datetime "created_at" t.datetime "updated_at" end @@ -148,26 +148,26 @@ add_index "unconfirmable_users", ["uid", "provider"], name: "index_unconfirmable_users_on_uid_and_provider", unique: true create_table "unregisterable_users", force: :cascade do |t| - t.string "provider", limit: 255, null: false - t.string "uid", limit: 255, default: "", null: false - t.string "encrypted_password", limit: 255, default: "", null: false - t.string "reset_password_token", limit: 255 + t.string "provider", null: false + t.string "uid", default: "", null: false + t.string "encrypted_password", default: "", null: false + t.string "reset_password_token" t.datetime "reset_password_sent_at" t.datetime "remember_created_at" - t.integer "sign_in_count", limit: 4, default: 0, null: false + t.integer "sign_in_count", default: 0, null: false t.datetime "current_sign_in_at" t.datetime "last_sign_in_at" - t.string "current_sign_in_ip", limit: 255 - t.string "last_sign_in_ip", limit: 255 - t.string "confirmation_token", limit: 255 + t.string "current_sign_in_ip" + t.string "last_sign_in_ip" + t.string "confirmation_token" t.datetime "confirmed_at" t.datetime "confirmation_sent_at" - t.string "unconfirmed_email", limit: 255 - t.string "name", limit: 255 - t.string "nickname", limit: 255 - t.string "image", limit: 255 - t.string "email", limit: 255 - t.text "tokens", limit: 65535 + t.string "unconfirmed_email" + t.string "name" + t.string "nickname" + t.string "image" + t.string "email" + t.text "tokens" t.datetime "created_at" t.datetime "updated_at" end @@ -177,32 +177,32 @@ add_index "unregisterable_users", ["uid", "provider"], name: "index_unregisterable_users_on_uid_and_provider", unique: true create_table "users", force: :cascade do |t| - t.string "email", limit: 255 - t.string "encrypted_password", limit: 255, default: "", null: false - t.string "reset_password_token", limit: 255 + t.string "email" + t.string "encrypted_password", default: "", null: false + t.string "reset_password_token" t.datetime "reset_password_sent_at" - t.string "reset_password_redirect_url", limit: 255 + t.string "reset_password_redirect_url" t.datetime "remember_created_at" - t.integer "sign_in_count", limit: 4, default: 0, null: false + t.integer "sign_in_count", default: 0, null: false t.datetime "current_sign_in_at" t.datetime "last_sign_in_at" - t.string "current_sign_in_ip", limit: 255 - t.string "last_sign_in_ip", limit: 255 - t.string "confirmation_token", limit: 255 + t.string "current_sign_in_ip" + t.string "last_sign_in_ip" + t.string "confirmation_token" t.datetime "confirmed_at" t.datetime "confirmation_sent_at" - t.string "confirm_success_url", limit: 255 - t.string "unconfirmed_email", limit: 255 - t.string "name", limit: 255 - t.string "nickname", limit: 255 - t.string "image", limit: 255 - t.string "provider", limit: 255 - t.string "uid", limit: 255, default: "", null: false - t.text "tokens", limit: 65535 + t.string "confirm_success_url" + t.string "unconfirmed_email" + t.string "name" + t.string "nickname" + t.string "image" + t.string "provider" + t.string "uid", default: "", null: false + t.text "tokens" t.datetime "created_at" t.datetime "updated_at" - t.integer "operating_thetan", limit: 4 - t.string "favorite_color", limit: 255 + t.integer "operating_thetan" + t.string "favorite_color" end add_index "users", ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true