mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-07-16 11:31:04 +02:00
fix: Fixes #139
This commit is contained in:
parent
fe4ea648e4
commit
9ce5a8e5e2
39 changed files with 338 additions and 758 deletions
|
|
@ -36,7 +36,7 @@ export function CredentialSelector({
|
|||
description = "Select a credential for authentication, or leave empty for no auth.",
|
||||
showLabel = true,
|
||||
}: CredentialSelectorProps) {
|
||||
const { getAccessToken } = useAuth();
|
||||
useAuth();
|
||||
|
||||
const [credentials, setCredentials] = useState<CredentialResponse[]>([]);
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
|
@ -45,10 +45,7 @@ export function CredentialSelector({
|
|||
const fetchCredentials = useCallback(async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const accessToken = await getAccessToken();
|
||||
const response = await listCredentialsApiV1CredentialsGet({
|
||||
headers: { Authorization: `Bearer ${accessToken}` },
|
||||
});
|
||||
const response = await listCredentialsApiV1CredentialsGet({});
|
||||
if (response.error) {
|
||||
console.error("Failed to fetch credentials:", response.error);
|
||||
setCredentials([]);
|
||||
|
|
@ -63,7 +60,7 @@ export function CredentialSelector({
|
|||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
}, [getAccessToken]);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
fetchCredentials();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue