Skip to content

Commit f6149dd

Browse files
committed
Git credintions reset fixed
1 parent 6152fca commit f6149dd

8 files changed

Lines changed: 70 additions & 37 deletions

File tree

src/App.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -992,12 +992,12 @@ const App = () => {
992992
cancelLabel: 'Cancel',
993993
onConfirm: async () => {
994994
try {
995-
await gitCredentialManager.clearCredentials();
995+
await gitCredentialManager.clearMasterPassword();
996996
if (gitManager) {
997997
gitManager.clearCredentials();
998998
}
999999
setHasStoredCredentials(false);
1000-
showToast('Credentials cleared successfully.', 'success');
1000+
showToast('Credentials and master password cleared successfully.', 'success');
10011001
} catch (error) {
10021002
showToast(`Failed to clear credentials: ${(error as Error).message}`, 'error');
10031003
}
@@ -2909,6 +2909,16 @@ const App = () => {
29092909
open={masterPasswordModalOpen}
29102910
onClose={() => setMasterPasswordModalOpen(false)}
29112911
onSubmit={handleMasterPasswordSubmit}
2912+
onReset={async () => {
2913+
setMasterPasswordModalOpen(false);
2914+
await gitCredentialManager.clearMasterPassword();
2915+
if (gitManager) {
2916+
gitManager.clearCredentials();
2917+
}
2918+
setHasStoredCredentials(false);
2919+
showToast('Credentials reset. Please set up new credentials.', 'info');
2920+
setTimeout(() => handleSetupCredentials(), 300);
2921+
}}
29122922
isSetup={isMasterPasswordSetup}
29132923
showToast={showToast}
29142924
/>

src/components/GitCredentialsModal.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@ const GitCredentialsModal: React.FC<GitCredentialsModalProps> = ({
111111
>
112112
{t('modals.git_credentials.how_to_token')}
113113
</a>
114+
<span style={{ margin: '0 4px', color: '#666' }}>|</span>
115+
<a href="#" onClick={(e) => { e.preventDefault(); window.open('https://docs.gitlab.com/user/profile/personal_access_tokens.html', '_blank'); }}>GitLab</a>
116+
<span style={{ margin: '0 4px', color: '#666' }}>|</span>
117+
<a href="#" onClick={(e) => { e.preventDefault(); window.open('https://support.atlassian.com/bitbucket-cloud/docs/create-an-app-password/', '_blank'); }}>Bitbucket</a>
118+
<span style={{ margin: '0 4px', color: '#666' }}>|</span>
119+
<a href="#" onClick={(e) => { e.preventDefault(); window.open('https://docs.gitea.com/development/api-usage#generating-and-listing-api-tokens', '_blank'); }}>Gitea</a>
114120
</small>
115121
</div>
116122

src/components/MasterPasswordModal.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ interface MasterPasswordModalProps {
55
open: boolean;
66
onClose: () => void;
77
onSubmit: (password: string) => void;
8+
onReset?: () => void;
89
isSetup: boolean; // true if creating new master password, false if unlocking
910
showToast: (message: string, type?: 'success' | 'error' | 'info' | 'warning') => void;
1011
}
@@ -13,6 +14,7 @@ const MasterPasswordModal: React.FC<MasterPasswordModalProps> = ({
1314
open,
1415
onClose,
1516
onSubmit,
17+
onReset,
1618
isSetup,
1719
showToast
1820
}) => {
@@ -117,6 +119,21 @@ const MasterPasswordModal: React.FC<MasterPasswordModalProps> = ({
117119
</div>
118120
)}
119121

122+
{!isSetup && onReset && (
123+
<div style={{ textAlign: 'center', marginBottom: '8px' }}>
124+
<a
125+
href="#"
126+
onClick={(e) => {
127+
e.preventDefault();
128+
onReset();
129+
}}
130+
style={{ fontSize: '0.85em', color: '#888' }}
131+
>
132+
Forgot password? Reset credentials
133+
</a>
134+
</div>
135+
)}
136+
120137
<div className="modal-actions">
121138
<button onClick={onClose} className="modal-button cancel-button">Cancel</button>
122139
<button onClick={handleSubmit} className="modal-button submit-button">

src/i18n/locales/de.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -413,13 +413,13 @@
413413
"git_credentials": {
414414
"title_setup": "Git-Zugangsdaten einrichten",
415415
"title_required": "Git-Zugangsdaten erforderlich",
416-
"desc_setup": "Geben Sie Ihre GitHub-Zugangsdaten ein, um sich bei Remote-Repositories zu authentifizieren.",
416+
"desc_setup": "Geben Sie Ihre Git-Zugangsdaten ein, um sich bei Remote-Repositories zu authentifizieren (GitHub, GitLab, Bitbucket, Gitea, etc.).",
417417
"desc_required": "Bitte geben Sie Ihre Zugangsdaten ein, um fortzufahren.",
418-
"username_label": "GitHub Benutzername (nicht E-Mail)",
419-
"username_placeholder": "ihr-github-benutzername (z.B. gcclinux)",
420-
"username_help": "⚠️ Verwenden Sie Ihren GitHub-Benutzernamen (z.B. <strong>gcclinux</strong>), NICHT Ihre E-Mail-Adresse",
421-
"token_label": "Persönliches Zugangstoken (kein Passwort)",
422-
"token_placeholder": "ghp_xxxxxxxxxxxxxxxxxxxx",
418+
"username_label": "Git-Benutzername (nicht E-Mail)",
419+
"username_placeholder": "ihr-git-benutzername",
420+
"username_help": "⚠️ Verwenden Sie Ihren Git-Anbieter-Benutzernamen (z.B. <strong>gcclinux</strong>), NICHT Ihre E-Mail-Adresse",
421+
"token_label": "Persönliches Zugangstoken oder App-Passwort",
422+
"token_placeholder": "ihr-zugangstoken",
423423
"show_token": "Token anzeigen",
424424
"hide_token": "Token verbergen",
425425
"how_to_token": "Wie man ein persönliches Token erstellt",
@@ -432,7 +432,7 @@
432432
"title": "Git-Repository klonen",
433433
"subtitle": "Von GitHub, GitLab, Bitbucket oder einem anderen Repository klonen",
434434
"repo_url": "Repository URL",
435-
"repo_url_placeholder": "https://github.com/benutzer/repo.git",
435+
"repo_url_placeholder": "https://github.com/benutzer/repo.git oder https://gitlab.com/benutzer/repo.git",
436436
"repo_url_note": "Hinweis: Öffentliche Repositories funktionieren am besten im Web-Modus",
437437
"target_dir": "Zielverzeichnis",
438438
"target_dir_placeholder": "Ordner auswählen oder Verzeichnisname eingeben",

src/i18n/locales/en.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -413,13 +413,13 @@
413413
"git_credentials": {
414414
"title_setup": "Setup Git Credentials",
415415
"title_required": "Git Credentials Required",
416-
"desc_setup": "Enter your GitHub credentials to authenticate with remote repositories.",
416+
"desc_setup": "Enter your Git credentials to authenticate with remote repositories (GitHub, GitLab, Bitbucket, Gitea, etc.).",
417417
"desc_required": "Please provide your credentials to continue with this Git operation.",
418-
"username_label": "GitHub Username (not email)",
419-
"username_placeholder": "your-github-username (e.g., gcclinux)",
420-
"username_help": "⚠️ Use your GitHub username (e.g., <strong>gcclinux</strong>), NOT your email address",
421-
"token_label": "Personal Access Token (not password)",
422-
"token_placeholder": "ghp_xxxxxxxxxxxxxxxxxxxx",
418+
"username_label": "Git Username (not email)",
419+
"username_placeholder": "your-git-username",
420+
"username_help": "⚠️ Use your Git provider username (e.g., <strong>gcclinux</strong>), NOT your email address",
421+
"token_label": "Personal Access Token or App Password",
422+
"token_placeholder": "your-access-token",
423423
"show_token": "Show token",
424424
"hide_token": "Hide token",
425425
"how_to_token": "How to create a personal access token",
@@ -432,7 +432,7 @@
432432
"title": "Clone Git Repository",
433433
"subtitle": "Clone from GitHub, GitLab, Bitbucket, or any public Git repository",
434434
"repo_url": "Repository URL",
435-
"repo_url_placeholder": "https://github.com/username/repository.git",
435+
"repo_url_placeholder": "https://github.com/user/repo.git or https://gitlab.com/user/repo.git",
436436
"repo_url_note": "Note: Public repositories work best in web mode",
437437
"target_dir": "Target Directory",
438438
"target_dir_placeholder": "Select folder or enter directory name",

src/i18n/locales/nl.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -413,13 +413,13 @@
413413
"git_credentials": {
414414
"title_setup": "Git Inloggegevens Instellen",
415415
"title_required": "Git Inloggegevens Vereist",
416-
"desc_setup": "Voer uw GitHub inloggegevens in om te authenticeren met externe repositories.",
416+
"desc_setup": "Voer uw Git inloggegevens in om te authenticeren met externe repositories (GitHub, GitLab, Bitbucket, Gitea, etc.).",
417417
"desc_required": "Voer uw inloggegevens in om door te gaan.",
418-
"username_label": "GitHub Gebruikersnaam (geen e-mail)",
419-
"username_placeholder": "uw-github-naam (bijv. gcclinux)",
420-
"username_help": "⚠️ Gebruik uw GitHub gebruikersnaam (bijv. <strong>gcclinux</strong>), NIET uw e-mailadres",
421-
"token_label": "Persoonlijk Toegangstoken (geen wachtwoord)",
422-
"token_placeholder": "ghp_xxxxxxxxxxxxxxxxxxxx",
418+
"username_label": "Git Gebruikersnaam (geen e-mail)",
419+
"username_placeholder": "uw-git-naam",
420+
"username_help": "⚠️ Gebruik uw Git-provider gebruikersnaam (bijv. <strong>gcclinux</strong>), NIET uw e-mailadres",
421+
"token_label": "Persoonlijk Toegangstoken of App-wachtwoord",
422+
"token_placeholder": "uw-toegangstoken",
423423
"show_token": "Toon token",
424424
"hide_token": "Verberg token",
425425
"how_to_token": "Hoe een token aanmaken",
@@ -432,7 +432,7 @@
432432
"title": "Kloon Git Repository",
433433
"subtitle": "Kloon van GitHub, GitLab, Bitbucket of een andere repository",
434434
"repo_url": "Repository URL",
435-
"repo_url_placeholder": "https://github.com/gebruiker/repo.git",
435+
"repo_url_placeholder": "https://github.com/gebruiker/repo.git of https://gitlab.com/gebruiker/repo.git",
436436
"repo_url_note": "Let op: Publieke repositories werken het beste in web-modus",
437437
"target_dir": "Doelmap",
438438
"target_dir_placeholder": "Selecteer map of typ mapnaam",

src/i18n/locales/pl.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -413,13 +413,13 @@
413413
"git_credentials": {
414414
"title_setup": "Konfiguracja Poświadczeń Git",
415415
"title_required": "Wymagane Poświadczenia Git",
416-
"desc_setup": "Wprowadź swoje dane GitHub, aby uwierzytelnić się w zdalnych repozytoriach.",
416+
"desc_setup": "Wprowadź swoje dane Git, aby uwierzytelnić się w zdalnych repozytoriach (GitHub, GitLab, Bitbucket, Gitea, itp.).",
417417
"desc_required": "Wprowadź swoje dane, aby kontynuować.",
418-
"username_label": "Nazwa użytkownika GitHub (nie email)",
419-
"username_placeholder": "twoja-nazwa-uzytkownika (np. gcclinux)",
420-
"username_help": "⚠️ Użyj nazwy użytkownika GitHub (np. <strong>gcclinux</strong>), NIE adresu email",
421-
"token_label": "Osobisty Token Dostępu (nie hasło)",
422-
"token_placeholder": "ghp_xxxxxxxxxxxxxxxxxxxx",
418+
"username_label": "Nazwa użytkownika Git (nie email)",
419+
"username_placeholder": "twoja-nazwa-uzytkownika",
420+
"username_help": "⚠️ Użyj nazwy użytkownika dostawcy Git (np. <strong>gcclinux</strong>), NIE adresu email",
421+
"token_label": "Osobisty Token Dostępu lub Hasło Aplikacji",
422+
"token_placeholder": "twój-token-dostępu",
423423
"show_token": "Pokaż token",
424424
"hide_token": "Ukryj token",
425425
"how_to_token": "Jak utworzyć token dostępu",
@@ -432,7 +432,7 @@
432432
"title": "Sklonuj Repozytorium Git",
433433
"subtitle": "Klonuj z GitHub, GitLab, Bitbucket lub innego repozytorium",
434434
"repo_url": "URL Repozytorium",
435-
"repo_url_placeholder": "https://github.com/uzytkownik/repo.git",
435+
"repo_url_placeholder": "https://github.com/uzytkownik/repo.git lub https://gitlab.com/uzytkownik/repo.git",
436436
"repo_url_note": "Uwaga: Publiczne repozytoria działają najlepiej w trybie web",
437437
"target_dir": "Katalog Docelowy",
438438
"target_dir_placeholder": "Wybierz katalog lub wpisz nazwę",

src/i18n/locales/pt-br.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -413,13 +413,13 @@
413413
"git_credentials": {
414414
"title_setup": "Configurar Credenciais Git",
415415
"title_required": "Credenciais Git Necessárias",
416-
"desc_setup": "Insira suas credenciais do GitHub para autenticar com repositórios remotos.",
416+
"desc_setup": "Insira suas credenciais Git para autenticar com repositórios remotos (GitHub, GitLab, Bitbucket, Gitea, etc.).",
417417
"desc_required": "Por favor forneça suas credenciais para continuar com esta operação Git.",
418-
"username_label": "Nome de Usuário GitHub (não email)",
419-
"username_placeholder": "seu-usuario-github (ex: gcclinux)",
420-
"username_help": "⚠️ Use seu nome de usuário GitHub (ex: <strong>gcclinux</strong>), NÃO seu endereço de email",
421-
"token_label": "Token de Acesso Pessoal (não senha)",
422-
"token_placeholder": "ghp_xxxxxxxxxxxxxxxxxxxx",
418+
"username_label": "Nome de Usuário Git (não email)",
419+
"username_placeholder": "seu-usuario-git",
420+
"username_help": "⚠️ Use seu nome de usuário do provedor Git (ex: <strong>gcclinux</strong>), NÃO seu endereço de email",
421+
"token_label": "Token de Acesso Pessoal ou Senha de App",
422+
"token_placeholder": "seu-token-de-acesso",
423423
"show_token": "Mostrar token",
424424
"hide_token": "Ocultar token",
425425
"how_to_token": "Como criar um token de acesso pessoal",
@@ -432,7 +432,7 @@
432432
"title": "Clonar Repositório Git",
433433
"subtitle": "Clone do GitHub, GitLab, Bitbucket ou qualquer repositório Git público",
434434
"repo_url": "URL do Repositório",
435-
"repo_url_placeholder": "https://github.com/usuario/repositorio.git",
435+
"repo_url_placeholder": "https://github.com/usuario/repo.git ou https://gitlab.com/usuario/repo.git",
436436
"repo_url_note": "Nota: Repositórios públicos funcionam melhor no modo web",
437437
"target_dir": "Diretório de Destino",
438438
"target_dir_placeholder": "Selecione a pasta ou digite o nome do diretório",

0 commit comments

Comments
 (0)