0
0
Fork 0

Revocable sessions (#3616)

* feat: Revocable sessions

* fix: Tests using sign_in

* feat: Configuration entry for the maximum number of session activations
This commit is contained in:
Sorin Davidoi 2017-06-23 18:50:53 +02:00 committed by Eugen Rochko
parent 3783cadf2d
commit 2211e8d1cd
9 changed files with 116 additions and 1 deletions

View file

@ -0,0 +1,13 @@
class CreateSessionActivations < ActiveRecord::Migration[5.1]
def change
create_table :session_activations do |t|
t.integer :user_id, null: false
t.string :session_id, null: false
t.timestamps
end
add_index :session_activations, :user_id
add_index :session_activations, :session_id, unique: true
end
end

View file

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20170610000000) do
ActiveRecord::Schema.define(version: 20170623152212) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -250,6 +250,15 @@ ActiveRecord::Schema.define(version: 20170610000000) do
t.index ["target_account_id"], name: "index_reports_on_target_account_id"
end
create_table "session_activations", force: :cascade do |t|
t.integer "user_id", null: false
t.string "session_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["session_id"], name: "index_session_activations_on_session_id", unique: true
t.index ["user_id"], name: "index_session_activations_on_user_id"
end
create_table "settings", id: :serial, force: :cascade do |t|
t.string "var", null: false
t.text "value"