mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-06-29 03:14:19 +00:00
ui
# What does this PR do? ## Test Plan # What does this PR do? ## Test Plan # What does this PR do? ## Test Plan
This commit is contained in:
parent
114946ae88
commit
a4d84f7805
22 changed files with 821 additions and 38 deletions
28
llama_stack/ui/hooks/use-auth-config.ts
Normal file
28
llama_stack/ui/hooks/use-auth-config.ts
Normal file
|
@ -0,0 +1,28 @@
|
|||
import { useState, useEffect } from "react";
|
||||
|
||||
export function useAuthConfig() {
|
||||
const [isAuthConfigured, setIsAuthConfigured] = useState(true);
|
||||
const [isChecking, setIsChecking] = useState(true);
|
||||
|
||||
useEffect(() => {
|
||||
const checkAuthConfig = async () => {
|
||||
try {
|
||||
const response = await fetch("/api/auth/github/login", {
|
||||
method: "HEAD",
|
||||
redirect: "manual",
|
||||
});
|
||||
|
||||
setIsAuthConfigured(response.status !== 404);
|
||||
} catch (error) {
|
||||
console.error("Auth config check error:", error);
|
||||
setIsAuthConfigured(true);
|
||||
} finally {
|
||||
setIsChecking(false);
|
||||
}
|
||||
};
|
||||
|
||||
checkAuthConfig();
|
||||
}, []);
|
||||
|
||||
return { isAuthConfigured, isChecking };
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue