diff options
author | Drew Blessing <drew@gitlab.com> | 2016-08-20 13:07:00 -0500 |
---|---|---|
committer | Drew Blessing <drew@gitlab.com> | 2016-08-26 15:10:31 -0500 |
commit | dcc20876554ae18c6869b80071728f1b91858c5f (patch) | |
tree | 5e5dc709238c54a8e5213cd11f577751fc744ef8 /lib/gitlab_net.rb | |
parent | 3043b31c458bf720843a84b35c9fbad5c1488c1d (diff) | |
download | gitlab-shell-dcc20876554ae18c6869b80071728f1b91858c5f.tar.gz |
Add option to recover 2FA via SSH
Diffstat (limited to 'lib/gitlab_net.rb')
-rw-r--r-- | lib/gitlab_net.rb | 9 |
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 |