Added API key access to AUTO_LOGIN=True and fixed SecretKeyModal (#1994)

* chore: Add type attribute to button in SecretKeyModal

* chore: Refactor Header component to fix autoLogin button visibility

* docs(api.mdx): update admonition message to remove reference to LANGFLOW_AUTO_LOGIN environment variable
docs(cli.mdx): update CLI command example to use 'run' subcommand instead of no arguments
feat(cli.mdx): add 'api-key' command to create API key for default superuser when LANGFLOW_AUTO_LOGIN is True

* docs(api.mdx): update admonition message to remove reference to LANGFLOW_AUTO_LOGIN environment variable

* chore: Fix typo in get-curl-code.tsx

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-05-28 12:02:40 -07:00 • committed by GitHub
commit 8f6b9d6443
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 48 additions and 9 deletions

View file

@ -56,7 +56,7 @@ export default function Header(): JSX.Element {
const lastFlowVisitedIndex = routeHistory
.reverse()
.findIndex(
(path) => path.includes("/flow/") && path !== location.pathname,
(path) => path.includes("/flow/") && path !== location.pathname
);
const lastFlowVisited = routeHistory[lastFlowVisitedIndex];
@ -181,7 +181,7 @@ export default function Header(): JSX.Element {
/>
</div>
</AlertDropdown>
{!autoLogin && (
{autoLogin && (
<button
onClick={() => {
navigate("/account/api-keys");

View file

@ -21,6 +21,6 @@ export default function getCurlCode(
-d '{"input_value": "message",
"output_type": "chat",
"input_type": "chat",
"tweaks": ${JSON.stringify(tweaksObject, null, 2)}'
"tweaks": ${JSON.stringify(tweaksObject, null, 2)}}'
`;
}

View file

@ -147,6 +147,7 @@ export default function SecretKeyModal({
{renderKey === false && (
<div className="float-right">
<Button
type="button"
className="mr-3"
variant="outline"
onClick={() => {