Skip to content

Commit

Permalink
Revoke access tokens for currently suspended users
Browse files Browse the repository at this point in the history
We've updated our user suspension logic to revoke all of a user's access
tokens. This migration backfills that fix for existing, currently
suspended users. This is important because tokens can have long TTLs
  • Loading branch information
mike29736 committed Aug 17, 2023
1 parent 4370ea7 commit 6f725c6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class RevokeAccessTokensForSuspendedUsers < ActiveRecord::Migration[7.0]
def up
User.with_status(User::USER_STATUS_SUSPENDED)
.find_each(&:revoke_all_authorisations)
end

def down; end
end
2 changes: 1 addition & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.0].define(version: 2023_08_04_094159) do
ActiveRecord::Schema[7.0].define(version: 2023_08_16_164936) do
create_table "batch_invitation_application_permissions", id: :integer, charset: "utf8mb3", force: :cascade do |t|
t.integer "batch_invitation_id", null: false
t.integer "supported_permission_id", null: false
Expand Down

0 comments on commit 6f725c6

Please sign in to comment.