diff options
| author | Patrick Steinhardt <ps@pks.im> | 2019-04-16 10:52:47 +0200 |
|---|---|---|
| committer | Patrick Steinhardt <ps@pks.im> | 2019-04-16 11:56:57 +0200 |
| commit | e9aa84799a6417d9404dc72599d04b205d8ff98b (patch) | |
| tree | fca4d54835c400ea93de1df4658301cddaef43eb /examples | |
| parent | 635ec366d7f49f95c3c0ad2ce06a62fdc7c5d91a (diff) | |
| download | libgit2-e9aa84799a6417d9404dc72599d04b205d8ff98b.tar.gz | |
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.
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/common.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/examples/common.c b/examples/common.c index ee4710710..aae9f97c1 100644 --- a/examples/common.c +++ b/examples/common.c @@ -362,6 +362,11 @@ int cred_acquire_cb(git_cred **out, goto out; error = git_cred_userpass_plaintext_new(out, username, password); + } else if (allowed_types & GIT_CREDTYPE_USERNAME) { + if ((error = ask(&username, "Username:")) < 0) + goto out; + + error = git_cred_username_new(out, username); } out: |
