-
Notifications
You must be signed in to change notification settings - Fork 745
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: auth + stripe, fix: pipe store subcommand
- Loading branch information
1 parent
e90d426
commit 22105fe
Showing
15 changed files
with
1,045 additions
and
335 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { SignInButton, SignOutButton, useUser } from "@clerk/nextjs"; | ||
import { Button } from "./ui/button"; | ||
import { useEffect } from "react"; | ||
import posthog from "posthog-js"; | ||
import { useSettings } from "@/lib/hooks/use-settings"; | ||
export function AuthButton() { | ||
const { isSignedIn, user } = useUser(); | ||
const { settings } = useSettings(); | ||
|
||
useEffect(() => { | ||
posthog.identify(settings.userId, { | ||
email: user?.primaryEmailAddress?.emailAddress, | ||
clerkId: user?.id, | ||
}); | ||
posthog.setPersonProperties({ | ||
email: user?.primaryEmailAddress?.emailAddress, | ||
clerkId: user?.id, | ||
}); | ||
}, [isSignedIn, user, settings.userId]); | ||
|
||
return ( | ||
<div > | ||
{isSignedIn ? ( | ||
<SignOutButton> | ||
<Button variant="outline"> | ||
sign out | ||
</Button> | ||
</SignOutButton> | ||
) : ( | ||
<SignInButton mode="redirect"> | ||
<Button variant="outline"> | ||
sign in | ||
</Button> | ||
</SignInButton> | ||
)} | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.