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

Commit

Permalink
Replaced print auth token with copy to clipboard
Browse files Browse the repository at this point in the history
Signed-off-by: Omkar Phansopkar <omkarphansopkar@gmail.com>
  • Loading branch information
OmkarPh committed Mar 18, 2024
1 parent aaaf54e commit 9288e42
Showing 1 changed file with 9 additions and 2 deletions.
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

0 comments on commit 9288e42

Please sign in to comment.