-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #116 from FleetAdmiralJakob/google-oauth
feat(auth): added google auth
- Loading branch information
Showing
6 changed files
with
79 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
"use client"; | ||
|
||
import React from "react"; | ||
import { Button } from "@/components/ui/button"; | ||
import { useAuthActions } from "@convex-dev/auth/react"; | ||
import { GitHubLogoIcon } from "@radix-ui/react-icons"; | ||
import { SiGoogle } from "@icons-pack/react-simple-icons"; | ||
|
||
const AuthPage = () => { | ||
const { signIn } = useAuthActions(); | ||
|
||
return ( | ||
<div className="container mx-auto min-h-screen py-12 pb-24 gap-8"> | ||
<h1 className="text-center text-3xl font-semibold mb-6"> | ||
Select How To Sign In | ||
</h1> | ||
|
||
<div className="w-full gap-8 flex justify-center"> | ||
<Button | ||
className="gap-1 flex" | ||
onClick={() => void signIn("google", { redirectTo: "/" })} | ||
> | ||
<SiGoogle className="w-4 h-4" /> Google | ||
</Button> | ||
<Button | ||
className="gap-1 flex" | ||
onClick={() => void signIn("github", { redirectTo: "/" })} | ||
> | ||
<GitHubLogoIcon className="w-4 h-4" /> GitHub | ||
</Button> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default AuthPage; |
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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
import GitHub from "@auth/core/providers/github"; | ||
import Resend from "@auth/core/providers/resend"; | ||
import Google from "@auth/core/providers/google"; | ||
import { convexAuth } from "@convex-dev/auth/server"; | ||
|
||
export const { auth, signIn, signOut, store } = convexAuth({ | ||
providers: [GitHub, Resend], | ||
providers: [GitHub, Resend, Google], | ||
}); |
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