diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2015-07-06 10:59:05 +0000 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2015-07-06 10:59:05 +0000 |
commit | b27f990de8a1b53974eb9aa0bd6bdde18f93d6db (patch) | |
tree | 72aee72a5d7944bb02dc29f1db66bafd40b4fd04 | |
parent | 4eebf9600e43cf6b0abffe0ffcde20cffc9b2800 (diff) | |
parent | c9b153e7de2a3a7158cd8ea766ed0a65dd248cc9 (diff) | |
download | gitlab-ci-b27f990de8a1b53974eb9aa0bd6bdde18f93d6db.tar.gz |
Merge branch 'access_token' into 'master'
Remove old sessions in order to force a new access_token access
/cc @vsizov @jacobvosmaer
See merge request !188
-rw-r--r-- | app/controllers/application_controller.rb | 6 | ||||
-rw-r--r-- | db/migrate/20150706103229_truncate_sessions.rb | 9 | ||||
-rw-r--r-- | db/schema.rb | 4 |
3 files changed, 11 insertions, 8 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 8700317..9852736 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -12,12 +12,6 @@ class ApplicationController < ActionController::Base def current_user @current_user ||= session[:current_user] - - # Backward compatibility. Until 7.13 user session doesn't contain access_token - # Users with old session should be logged out - return nil if @current_user && @current_user.access_token.nil? - - @current_user end def sign_in(user) diff --git a/db/migrate/20150706103229_truncate_sessions.rb b/db/migrate/20150706103229_truncate_sessions.rb new file mode 100644 index 0000000..32fe651 --- /dev/null +++ b/db/migrate/20150706103229_truncate_sessions.rb @@ -0,0 +1,9 @@ +class TruncateSessions < ActiveRecord::Migration + def up + execute('DELETE FROM sessions') + end + + def down + execute('DELETE FROM sessions') + end +end diff --git a/db/schema.rb b/db/schema.rb index b1eaef6..f3e9e40 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20150616001155) do +ActiveRecord::Schema.define(version: 20150706103229) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -175,7 +175,7 @@ ActiveRecord::Schema.define(version: 20150616001155) do add_index "tags", ["name"], name: "index_tags_on_name", unique: true, using: :btree create_table "variables", force: true do |t| - t.integer "project_id", null: false + t.integer "project_id", null: false t.string "key" t.text "value" end |