Skip to content

Commit

Permalink
try id deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
nikos-koukis committed Oct 11, 2023
1 parent 2558f15 commit 76d5133
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 13 deletions.
15 changes: 9 additions & 6 deletions src/pages/api/auth/[...nextauth].ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
import NextAuth from "next-auth"
import GoogleProvider from "next-auth/providers/google"
import { Session, DefaultSession } from "next-auth"


export const authOptions = {
export default NextAuth({
providers: [
GoogleProvider({
clientId: process.env.NEXT_PUBLIC_GOOGLE_CLIENT_ID || '914628494898-onc9q6mppitoa680q721r42ki64hh556.apps.googleusercontent.com',
clientSecret: process.env.NEXT_PUBLIC_GOOGLE_CLIENT_SECRET || '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',
}),
],
secret: process.env.NEXT_PUBLIC_AUTH_SECRET || 'hackathon',
}

export default NextAuth(authOptions)

callbacks: {
session({ session, token }) {
session.user.sub = token.sub ;
return session;
},
},
})
1 change: 1 addition & 0 deletions src/views/Home/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const Home = () => {
return (
<Box>
Signed in as {session?.user?.email} <br />
ID: {session?.user?.sub} <br />
<Button
w={'fit'}
_hover={{
Expand Down
26 changes: 19 additions & 7 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,34 @@
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"paths": {
"@/*": ["./src/*"]
}
"@/*": [
"./src/*"
]
},
"moduleResolution": "node",
"resolveJsonModule": true
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx"
],
"exclude": [
"node_modules"
]
}
9 changes: 9 additions & 0 deletions types/next-auth.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import NextAuth from 'next-auth';

declare module 'next-auth' {
interface Session {
user: {
id: string;
} & DefaultSession['user'];
}
}

0 comments on commit 76d5133

Please sign in to comment.