Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show currently active key in settings #542

Merged
merged 1 commit into from
Jul 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions skyvern-frontend/src/routes/settings/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@ import {
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { envCredential } from "@/util/env";
import { HiddenCopyableInput } from "@/components/ui/hidden-copyable-input";

function Settings() {
const { environment, organization, setEnvironment, setOrganization } =
useSettingsStore();
const apiKey = envCredential;

return (
<div className="flex flex-col gap-8">
Expand Down Expand Up @@ -55,6 +58,15 @@ function Settings() {
</div>
</CardContent>
</Card>
<Card>
<CardHeader className="border-b-2">
<CardTitle className="text-lg">API Key</CardTitle>
<CardDescription>Currently active API key</CardDescription>
</CardHeader>
<CardContent className="p-8">
<HiddenCopyableInput value={apiKey ?? "API key not found"} />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Displaying sensitive information such as API keys in the UI can pose a security risk. Ensure that this feature includes adequate access controls and security measures to protect the API key from unauthorized access.

</CardContent>
</Card>
</div>
);
}
Expand Down
Loading