summaryrefslogtreecommitdiff
path: root/app/models/user.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/user.rb')
-rw-r--r--app/models/user.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index dc84f5141d8..317257a2500 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -322,6 +322,16 @@ class User < ActiveRecord::Base
@reset_token
end
+ def disable_two_factor!
+ update_attributes(
+ two_factor_enabled: false,
+ encrypted_otp_secret: nil,
+ encrypted_otp_secret_iv: nil,
+ encrypted_otp_secret_salt: nil,
+ otp_backup_codes: nil
+ )
+ end
+
def namespace_uniq
namespace_name = self.username
existing_namespace = Namespace.by_path(namespace_name)