Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

feat: Replaced print auth token with copy to clipboard #514

Merged
merged 1 commit into from
Apr 1, 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
11 changes: 9 additions & 2 deletions src/components/PrimaryNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import useSupabaseAuth from "../hooks/useSupabaseAuth";
import { version } from "../../package.json";
import openSaucedLogo from "../assets/openSauced.svg";
import { supabase } from "../lib/supabase";
import { ToastTrigger } from "../lib/reactHotToast";

import RepoSubmission from "./RepoSubmission";

Expand Down Expand Up @@ -144,9 +145,15 @@ const PrimaryNav = (): JSX.Element => {
<button
className={`${active ? "bg-gray-100 text-gray-700" : "text-gray-900"
} group flex w-full items-center rounded-md px-5 py-1.5 text-sm`}
onClick={() => console.log("Token: ", currentUser?.access_token)}
onClick={async () => {
if (!currentUser?.access_token) {
return;
}
await navigator.clipboard.writeText(currentUser.access_token);
ToastTrigger({ message: "Auth Token copied to clipboard", type: "success" });
}}
>
Print auth token
Copy auth token
</button>
)}
</Menu.Item>
Expand Down
Loading