Skip to content

Commit

Permalink
feat: update example apps with auth-kit@0.1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
horsefacts committed Jan 27, 2024
1 parent df57823 commit 12d6b75
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 26 deletions.
2 changes: 1 addition & 1 deletion examples/frontend-only/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"preview": "vite preview"
},
"dependencies": {
"@farcaster/auth-kit": "^0.0.38",
"@farcaster/auth-kit": "^0.1.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"viem": "^2.0.3"
Expand Down
11 changes: 8 additions & 3 deletions examples/frontend-only/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ function App() {
This example app shows how to use{" "}
<a
href="https://docs.farcaster.xyz/auth-kit/introduction"
target="_blank"
target="_blank" rel="noreferrer"
>
Farcaster AuthKit
</a>{" "}
and{" "}
<a href="https://vitejs.dev/" target="_blank">
<a href="https://vitejs.dev/" target="_blank" rel="noreferrer">
Vite
</a>
.
Expand Down Expand Up @@ -67,15 +67,20 @@ function Profile() {
const profile = useProfile();
const {
isAuthenticated,
profile: { fid, displayName },
profile: { fid, displayName, custody },
} = profile;

return (
<>
{isAuthenticated ? (
<div>
<p>
Hello, {displayName}! Your FID is {fid}.
</p>
<p>
Your custody address is: <pre>{custody}</pre>
</p>
</div>
) : (
<p>
Click the "Sign in with Farcaster" button above, then scan the QR code
Expand Down
18 changes: 9 additions & 9 deletions examples/frontend-only/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -377,21 +377,21 @@
resolved "https://registry.npmjs.org/@eslint/js/-/js-8.56.0.tgz#ef20350fec605a7f7035a01764731b2de0f3782b"
integrity sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A==

"@farcaster/auth-client@^0.0.22":
version "0.0.22"
resolved "https://registry.npmjs.org/@farcaster/auth-client/-/auth-client-0.0.22.tgz#776899c1acebfa19020a470f43f46ac8be3da264"
integrity sha512-F2pLeFOJVHTuxpZBQH/UiCKPlh8rxQYOUDx0vrNjlPn6Zh28lTv5zbwbgOfHk1+w+jgUqWdetDvt/CEJ7s4Irg==
"@farcaster/auth-client@^0.1.0":
version "0.1.0"
resolved "https://registry.npmjs.org/@farcaster/auth-client/-/auth-client-0.1.0.tgz#3f1608ee8398bc71e8da23a898aa721b36ce78d3"
integrity sha512-hWeUDwpyNNswclL82K5wt6sA0x0UjELGhLKSZK6JYvGAE6wNR6V8o1IBhZYIGASWHHxOGoJLZ1L1xRcvS3GbUQ==
dependencies:
ethers "^6.9.2"
neverthrow "^6.1.0"
siwe "^2.1.4"

"@farcaster/auth-kit@^0.0.38":
version "0.0.38"
resolved "https://registry.npmjs.org/@farcaster/auth-kit/-/auth-kit-0.0.38.tgz#4c73d829c57833fda03fc9635503d713c67f4f62"
integrity sha512-kZr83YnYbgPaWJX7mGq+MLa6GO870zFLFs6nGPVbyt/K4ANXoWOzueo0yrnhDomkcZH+Wp/fW6IL5PDqSONyaQ==
"@farcaster/auth-kit@^0.1.2":
version "0.1.2"
resolved "https://registry.npmjs.org/@farcaster/auth-kit/-/auth-kit-0.1.2.tgz#e84d3841f4cd0821034a10d9ffecdd86deb9fab4"
integrity sha512-n7jCBELVVLjKRt9hD5+f5L/z7iZRneAD2kHCOl5d7TRkiATn/Zp6f47ElpKd5fO0seR3k+R1+TyzKUXN8CEKNQ==
dependencies:
"@farcaster/auth-client" "^0.0.22"
"@farcaster/auth-client" "^0.1.0"
"@vanilla-extract/css" "^1.14.0"
qrcode "^1.5.3"
react-remove-scroll "^2.5.7"
Expand Down
2 changes: 1 addition & 1 deletion examples/with-next-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"lint": "next lint"
},
"dependencies": {
"@farcaster/auth-kit": "^0.0.38",
"@farcaster/auth-kit": "^0.1.4",
"next": "14.0.4",
"next-auth": "^4.24.5",
"react": "^18.2.0",
Expand Down
1 change: 0 additions & 1 deletion examples/with-next-auth/pages/api/auth/[...nextauth].ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import NextAuth from "next-auth";
import CredentialsProvider from "next-auth/providers/credentials";
import { createAppClient, viemConnector } from "@farcaster/auth-client";
import { NextApiRequest, NextApiResponse } from "next";
import { getCsrfToken } from "next-auth/react";

export default (req: NextApiRequest, res: NextApiResponse) =>
NextAuth(req, res, {
Expand Down
6 changes: 4 additions & 2 deletions examples/with-next-auth/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ function Content() {
nonce={getNonce}
onSuccess={handleSuccess}
onError={() => setError(true)}
onSignOut={() => signOut() }
/>
{error && <div>Unable to sign in at this time.</div>}
</div>
Expand All @@ -69,12 +70,12 @@ function Content() {
This example app shows how to use{" "}
<a
href="https://docs.farcaster.xyz/auth-kit/introduction"
target="_blank"
target="_blank" rel="noreferrer"
>
Farcaster AuthKit
</a>{" "}
and{" "}
<a href="https://next-auth.js.org/" target="_blank">
<a href="https://next-auth.js.org/" target="_blank" rel="noreferrer">
NextAuth.js
</a>
.
Expand Down Expand Up @@ -116,6 +117,7 @@ function Profile() {
<p>Signed in as {session.user?.name}</p>
<p>
<button
type="button"
style={{ padding: "6px 12px", cursor: "pointer" }}
onClick={() => signOut()}
>
Expand Down
18 changes: 9 additions & 9 deletions examples/with-next-auth/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@
resolved "https://registry.npmjs.org/@emotion/hash/-/hash-0.9.1.tgz#4ffb0055f7ef676ebc3a5a91fb621393294e2f43"
integrity sha512-gJB6HLm5rYwSLI6PQa+X1t5CFGrv1J1TWG+sOyMCeKz2ojaj6Fnl/rZEspogG+cvqbt4AE/2eIyD2QfLKTBNlQ==

"@farcaster/auth-client@^0.0.22":
version "0.0.22"
resolved "https://registry.npmjs.org/@farcaster/auth-client/-/auth-client-0.0.22.tgz#776899c1acebfa19020a470f43f46ac8be3da264"
integrity sha512-F2pLeFOJVHTuxpZBQH/UiCKPlh8rxQYOUDx0vrNjlPn6Zh28lTv5zbwbgOfHk1+w+jgUqWdetDvt/CEJ7s4Irg==
"@farcaster/auth-client@^0.1.0":
version "0.1.0"
resolved "https://registry.npmjs.org/@farcaster/auth-client/-/auth-client-0.1.0.tgz#3f1608ee8398bc71e8da23a898aa721b36ce78d3"
integrity sha512-hWeUDwpyNNswclL82K5wt6sA0x0UjELGhLKSZK6JYvGAE6wNR6V8o1IBhZYIGASWHHxOGoJLZ1L1xRcvS3GbUQ==
dependencies:
ethers "^6.9.2"
neverthrow "^6.1.0"
siwe "^2.1.4"

"@farcaster/auth-kit@^0.0.38":
version "0.0.38"
resolved "https://registry.npmjs.org/@farcaster/auth-kit/-/auth-kit-0.0.38.tgz#4c73d829c57833fda03fc9635503d713c67f4f62"
integrity sha512-kZr83YnYbgPaWJX7mGq+MLa6GO870zFLFs6nGPVbyt/K4ANXoWOzueo0yrnhDomkcZH+Wp/fW6IL5PDqSONyaQ==
"@farcaster/auth-kit@^0.1.4":
version "0.1.4"
resolved "https://registry.npmjs.org/@farcaster/auth-kit/-/auth-kit-0.1.4.tgz#1b76195d018f3c8a3d01e45244e06e5527313f94"
integrity sha512-+SUdbme/NEcl4E2/ktwhvJMNgU5NHmaHUeCpgtvg8OIu52VvYEL6oChERjNJfVVlzvSub006E9KMC7Iao51tsQ==
dependencies:
"@farcaster/auth-client" "^0.0.22"
"@farcaster/auth-client" "^0.1.0"
"@vanilla-extract/css" "^1.14.0"
qrcode "^1.5.3"
react-remove-scroll "^2.5.7"
Expand Down

0 comments on commit 12d6b75

Please sign in to comment.