forked from phoenix/litellm-mirror
fix invite id flow
This commit is contained in:
parent
c3bbc4a692
commit
fdcdee8775
2 changed files with 33 additions and 10 deletions
|
@ -33,7 +33,7 @@ export default function Onboarding() {
|
|||
const [form] = Form.useForm();
|
||||
const searchParams = useSearchParams();
|
||||
const token = getCookie('token');
|
||||
const inviteID = searchParams.get("id");
|
||||
const inviteID = searchParams.get("invitation_id");
|
||||
const [accessToken, setAccessToken] = useState<string | null>(null);
|
||||
const [defaultUserEmail, setDefaultUserEmail] = useState<string>("");
|
||||
const [userEmail, setUserEmail] = useState<string>("");
|
||||
|
@ -92,7 +92,10 @@ export default function Onboarding() {
|
|||
).then((data) => {
|
||||
let litellm_dashboard_ui = "/ui/";
|
||||
const user_id = data.data?.user_id || data.user_id;
|
||||
litellm_dashboard_ui += "?userID=" + user_id + "&token=" + jwtToken;
|
||||
litellm_dashboard_ui += "?userID=" + user_id;
|
||||
|
||||
// set cookie "token" to jwtToken
|
||||
document.cookie = "token=" + jwtToken;
|
||||
console.log("redirecting to:", litellm_dashboard_ui);
|
||||
|
||||
window.location.href = litellm_dashboard_ui;
|
||||
|
@ -101,7 +104,7 @@ export default function Onboarding() {
|
|||
// redirect to login page
|
||||
};
|
||||
return (
|
||||
<div className="mx-auto max-w-md mt-10">
|
||||
<div className="mx-auto w-full max-w-md mt-10">
|
||||
<Card>
|
||||
<Title className="text-sm mb-5 text-center">🚅 LiteLLM</Title>
|
||||
<Title className="text-xl">Sign up</Title>
|
||||
|
|
|
@ -77,6 +77,7 @@ const CreateKeyPage = () => {
|
|||
const searchParams = useSearchParams();
|
||||
const [modelData, setModelData] = useState<any>({ data: [] });
|
||||
const userID = searchParams.get("userID");
|
||||
const invitation_id = searchParams.get("invitation_id");
|
||||
const token = getCookie('token');
|
||||
|
||||
const [page, setPage] = useState("api-keys");
|
||||
|
@ -128,7 +129,23 @@ const CreateKeyPage = () => {
|
|||
|
||||
return (
|
||||
<Suspense fallback={<div>Loading...</div>}>
|
||||
<div className="flex flex-col min-h-screen">
|
||||
{
|
||||
invitation_id ? (
|
||||
<UserDashboard
|
||||
userID={userID}
|
||||
userRole={userRole}
|
||||
teams={teams}
|
||||
keys={keys}
|
||||
setUserRole={setUserRole}
|
||||
userEmail={userEmail}
|
||||
setUserEmail={setUserEmail}
|
||||
setTeams={setTeams}
|
||||
setKeys={setKeys}
|
||||
setProxySettings={setProxySettings}
|
||||
proxySettings={proxySettings}
|
||||
/>
|
||||
) : (
|
||||
<div className="flex flex-col min-h-screen">
|
||||
<Navbar
|
||||
userID={userID}
|
||||
userRole={userRole}
|
||||
|
@ -140,11 +157,11 @@ const CreateKeyPage = () => {
|
|||
/>
|
||||
<div className="flex flex-1 overflow-auto">
|
||||
<div className="mt-8">
|
||||
<Sidebar
|
||||
setPage={setPage}
|
||||
userRole={userRole}
|
||||
defaultSelectedKey={null}
|
||||
/>
|
||||
<Sidebar
|
||||
setPage={setPage}
|
||||
userRole={userRole}
|
||||
defaultSelectedKey={null}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{page == "api-keys" ? (
|
||||
|
@ -251,6 +268,9 @@ const CreateKeyPage = () => {
|
|||
)}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
</Suspense>
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue