Persist password (#393)

* never hold the owner of the room on the waiting screen

* persist room passwords so we can always call create meeting, even if it's already running, to avoid any inconsistency or race condition when joining a meeting

* Fixed issues in migration, room attribute updates, random_password and tests
This commit is contained in:
Jesus Federico
2019-03-12 17:54:57 -04:00
committed by GitHub
parent 3195bb4429
commit 08f6f32779
7 changed files with 39 additions and 20 deletions

View File

@ -0,0 +1,15 @@
# frozen_string_literal: true
class AddPasswordToRooms < ActiveRecord::Migration[5.0]
def change
add_column :rooms, :moderator_pw, :string
add_column :rooms, :attendee_pw, :string
Room.reset_column_information
Room.all.each do |room|
room.update_attributes!(
moderator_pw: RandomPassword.generate(length: 12),
attendee_pw: RandomPassword.generate(length: 12)
)
end
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: 20190206210049) do
ActiveRecord::Schema.define(version: 20190312003555) do
create_table "rooms", force: :cascade do |t|
t.integer "user_id"
@ -22,6 +22,8 @@ ActiveRecord::Schema.define(version: 20190206210049) do
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "room_settings", default: "{ }"
t.string "moderator_pw"
t.string "attendee_pw"
t.index ["bbb_id"], name: "index_rooms_on_bbb_id"
t.index ["last_session"], name: "index_rooms_on_last_session"
t.index ["name"], name: "index_rooms_on_name"
@ -41,11 +43,10 @@ ActiveRecord::Schema.define(version: 20190206210049) do
t.string "image"
t.string "password_digest"
t.boolean "accepted_terms", default: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.boolean "email_verified", default: false
t.string "language", default: "default"
t.string "role", default: "moderator"
t.string "reset_digest"
t.datetime "reset_sent_at"
t.string "activation_digest"