Skip to content

Commit 10f10f1

Browse files
committed
🔄 Synced local '.' with remote 'apps/examples/nextjs'
1 parent 13f7b91 commit 10f10f1

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

auth.ts

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ import { createStorage } from "unstorage"
3737
import memoryDriver from "unstorage/drivers/memory"
3838
import vercelKVDriver from "unstorage/drivers/vercel-kv"
3939
import { UnstorageAdapter } from "@auth/unstorage-adapter"
40-
import type { NextAuthConfig } from "next-auth"
4140

4241
const storage = createStorage({
4342
driver: process.env.VERCEL
@@ -49,11 +48,12 @@ const storage = createStorage({
4948
: memoryDriver(),
5049
})
5150

52-
const config = {
51+
export const { handlers, auth, signIn, signOut } = NextAuth({
52+
debug: !!process.env.AUTH_DEBUG,
5353
theme: { logo: "https://authjs.dev/img/logo-sm.png" },
5454
adapter: UnstorageAdapter(storage),
5555
providers: [
56-
Apple({ redirectProxyUrl: "" }),
56+
Apple,
5757
// Atlassian,
5858
Auth0,
5959
AzureB2C,
@@ -97,9 +97,7 @@ const config = {
9797
Vipps({
9898
issuer: "https://apitest.vipps.no/access-management-1.0/access/",
9999
}),
100-
WorkOS({
101-
connection: process.env.AUTH_WORKOS_CONNECTION!,
102-
}),
100+
WorkOS({ connection: process.env.AUTH_WORKOS_CONNECTION! }),
103101
Zoom,
104102
],
105103
basePath: "/auth",
@@ -118,19 +116,13 @@ const config = {
118116
return token
119117
},
120118
async session({ session, token }) {
121-
if (token?.accessToken) {
122-
session.accessToken = token.accessToken
123-
}
119+
if (token?.accessToken) session.accessToken = token.accessToken
120+
124121
return session
125122
},
126123
},
127-
experimental: {
128-
enableWebAuthn: true,
129-
},
130-
debug: process.env.NODE_ENV !== "production" ? true : false,
131-
} satisfies NextAuthConfig
132-
133-
export const { handlers, auth, signIn, signOut } = NextAuth(config)
124+
experimental: { enableWebAuthn: true },
125+
})
134126

135127
declare module "next-auth" {
136128
interface Session {

0 commit comments

Comments
 (0)