fix(skills): drop GitHub-only regex gate on PAT input
The PAT input on the skill import flow was hidden by a regex that matched
github.com or org/repo shorthand. Self-hosted Gitea/Forgejo/GitLab sources
got no auth field at all. Always show the input when a source is entered,
and label it generically ('Personal access token') instead of 'GitHub PAT'.
UI only — backend already accepts any token via /skills/:id/auth and
/companies/:companyId/skills POST {source, authToken}.
This commit is contained in:
@@ -1345,13 +1345,13 @@ export function CompanySkills() {
|
|||||||
{importSkill.isPending ? <RefreshCw className="h-4 w-4 animate-spin" /> : "Add"}
|
{importSkill.isPending ? <RefreshCw className="h-4 w-4 animate-spin" /> : "Add"}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
{source.trim().length > 0 && /github\.com|^[a-zA-Z0-9_-]+\/[a-zA-Z0-9_.-]+/.test(source.trim()) && (
|
{source.trim().length > 0 && (
|
||||||
<div className="mt-1 flex items-center gap-2 border-b border-border pb-2">
|
<div className="mt-1 flex items-center gap-2 border-b border-border pb-2">
|
||||||
<input
|
<input
|
||||||
type="password"
|
type="password"
|
||||||
value={importAuthToken}
|
value={importAuthToken}
|
||||||
onChange={(event) => setImportAuthToken(event.target.value)}
|
onChange={(event) => setImportAuthToken(event.target.value)}
|
||||||
placeholder="GitHub PAT (optional, for private repos)"
|
placeholder="Personal access token (optional, for private repos)"
|
||||||
className="w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"
|
className="w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user