feat(git): enhance token authentication and credential handling
This commit is contained in:
@@ -177,18 +177,14 @@ export async function setLocalIdentity(directory, profile) {
|
||||
false,
|
||||
'local'
|
||||
);
|
||||
// Clear credential helper if previously set for token auth
|
||||
await git.raw(['config', '--local', '--unset', 'credential.helper']).catch(() => {});
|
||||
} else if (authType === 'token' && profile.host) {
|
||||
// For token auth, configure git to use the store credential helper
|
||||
// which reads from ~/.git-credentials
|
||||
await git.addConfig(
|
||||
'credential.helper',
|
||||
'store',
|
||||
false,
|
||||
'local'
|
||||
);
|
||||
// Clear SSH command if previously set
|
||||
await git.raw(['config', '--local', '--unset', 'core.sshCommand']).catch(() => {});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user