Skip to content

Commit e9aa847

Browse files
committed
examples: support plain username credentials
Implement plain username credential types. These type of credentials might be asked for e.g. as some kind of pre-authentication step, before the actual credentials are passed.
1 parent 635ec36 commit e9aa847

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

examples/common.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,11 @@ int cred_acquire_cb(git_cred **out,
362362
goto out;
363363

364364
error = git_cred_userpass_plaintext_new(out, username, password);
365+
} else if (allowed_types & GIT_CREDTYPE_USERNAME) {
366+
if ((error = ask(&username, "Username:")) < 0)
367+
goto out;
368+
369+
error = git_cred_username_new(out, username);
365370
}
366371

367372
out:

0 commit comments

Comments
 (0)