Skip to content

Commit 92cc44a

Browse files
committed
Fixes detecting two factor authentication
1 parent d1364d6 commit 92cc44a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

autoload/gist.vim

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -815,13 +815,12 @@ function! s:GistGetAuthHeader()
815815
\ "Content-Type" : "application/json",
816816
\ "Authorization" : insecureSecret,
817817
\})
818-
let h = filter(res.header, 'v:val =~ "^X-GitHub-OTP: require"')
818+
let h = filter(res.header, 'stridx(v:val, "X-GitHub-OTP:") == 0')
819819
if len(h)
820820
let otp = inputsecret("OTP:")
821821
if len(otp) == 0
822-
let secret = ''
823822
let v:errmsg = 'Canceled'
824-
return secrert
823+
return ''
825824
endif
826825
let res = webapi#http#post(g:github_api_url.'/authorizations', webapi#json#encode({
827826
\ "scopes" : ["gist"],

0 commit comments

Comments
 (0)