summaryrefslogtreecommitdiff
path: root/app/models/account.rb
diff options
context:
space:
mode:
authorThais Siqueira <thais.siqueira@gmail.com>2017-03-10 11:28:39 -0300
committerThais Siqueira <thais.siqueira@gmail.com>2017-03-10 11:28:39 -0300
commit417818997fca057635793cdf60a3e1bfa6716e35 (patch)
tree41406bc3f1a88fa606b871a810b00679c7a69859 /app/models/account.rb
parent67824594246aee807ebacdf61c4e2d0a136eab73 (diff)
Adds recovery code to user account
Related with https://github.com/pixelated/pixelated-user-agent/issues/924 With @aarni
Diffstat (limited to 'app/models/account.rb')
-rw-r--r--app/models/account.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/models/account.rb b/app/models/account.rb
index d722caa..0731cac 100644
--- a/app/models/account.rb
+++ b/app/models/account.rb
@@ -62,6 +62,9 @@ class Account
update_login(attrs[:login])
@user.update_attributes attrs.slice(:password_verifier, :password_salt)
end
+ if attrs[:recovery_code_verifier].present?
+ @user.update_attributes attrs.slice(:recovery_code_verifier, :recovery_code_salt)
+ end
# TODO: move into identity controller
key = update_pgp_key(attrs[:public_key])
@user.errors.set :public_key, key.errors.full_messages