Use rails_2factor gem.