summaryrefslogtreecommitdiff
path: root/lib/gitlab_net.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab_net.rb')
-rw-r--r--lib/gitlab_net.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/gitlab_net.rb b/lib/gitlab_net.rb
index 35a8833..47bae95 100644
--- a/lib/gitlab_net.rb
+++ b/lib/gitlab_net.rb
@@ -72,6 +72,15 @@ class GitlabNet
nil
end
+ def two_factor_recovery_codes(key)
+ key_id = key.gsub('key-', '')
+ resp = post("#{host}/two_factor_recovery_codes", key_id: key_id)
+
+ JSON.parse(resp.body) if resp.code == '200'
+ rescue
+ {}
+ end
+
def redis_client
redis_config = config.redis
database = redis_config['database'] || 0