Skip to content

Commit

Permalink
Merge branch 'main' into feat/api-cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
balazsorban44 authored Jan 1, 2025
2 parents 37bdc73 + 0820bb5 commit f47fd20
Show file tree
Hide file tree
Showing 195 changed files with 3,001 additions and 1,195 deletions.
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/2_bug_provider.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,12 @@ body:
- "Identity Server 4"
- "Instagram"
- "Kakao"
- "Frontegg"
- "Keycloak"
- "Kinde"
- "Line"
- "LinkedIn"
- "Loops"
- "Mailchimp"
- "Mail.ru"
- "Mastodon"
Expand Down
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
versioning-strategy: "increase"
allow:
- dependency-name: "oauth4webapi"
- dependency-name: "jose"
1 change: 1 addition & 0 deletions .github/pr-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ drizzle: ["packages/adapter-drizzle/**/*"]
documentation: ["packages/docs/docs/**/*"]
dynamodb: ["packages/adapter-dynamodb/**/*"]
examples: ["apps/examples/**/*"]
express: ["packages/frameworks-express/**/*"]
fauna: ["packages/adapter-fauna/**/*"]
firebase: ["packages/adapter-firebase/**/*"]
hasura: ["packages/adapter-hasura/**/*"]
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ env:
jobs:
test:
name: Test
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Init
uses: actions/checkout@v4
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
run: cd apps/examples/nextjs-docker && pnpm test:docker
- name: Run E2E tests
continue-on-error: true # TODO: Make this less flakey
if: github.repository == 'nextauthjs/next-auth'
if: ${{ env.PACKAGES_CHANGES == 'true' || github.ref == 'refs/heads/main' }}
timeout-minutes: 15
env:
AUTH_SECRET: ${{ secrets.AUTH_SECRET }}
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ docs/.next
docs/manifest.mjs

# Core
packages/core/src/providers/oauth-types.ts
packages/core/src/providers/provider-types.ts
packages/core/lib
packages/core/providers
packages/core/src/lib/pages/styles.ts
Expand Down
4 changes: 2 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ packages/**/*.js
!packages/*/scripts/*.js

# @auth/core
packages/core/src/providers/oauth-types.ts
packages/core/src/providers/provider-types.ts
packages/core/src/lib/pages/styles.ts

# @auth/sveltekit
Expand All @@ -43,7 +43,7 @@ packages/frameworks-sveltekit/vite.config.{js,ts}.timestamp-*
packages/frameworks-express/providers

# next-auth
packages/next-auth/src/providers/oauth-types.ts
packages/next-auth/src/providers/provider-types.ts
packages/next-auth/css/index.css

# Adapters
Expand Down
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,22 @@ We have an [OpenCollective](https://opencollective.com/nextauth) for companies a
<div>Encore</div>
<sub>💵</sub>
</td>
<td align="center" valign="top">
<a href="https://sent.dm/?ref=auth.js" target="_blank">
<img width="108" src="https://avatars.githubusercontent.com/u/153308555?v=4" alt="Sent.dm Logo" />
</a><br />
<div>Sent.dm</div>
<sub>💵</sub>
</td>
</tr>
<tr>
<td align="center" valign="top">
<a href="https://arcjet.com/?ref=auth.js" target="_blank">
<img width="108" src="https://avatars.githubusercontent.com/u/24397786?s=200&v=4" alt="Arcjet Logo" />
</a><br />
<div>Arcjet</div>
<sub>💵</sub>
</td>
</tr>
<tr>
<td align="center" valign="top">
<a href="https://route4me.com/?ref=auth.js" target="_blank">
<img width="108" src="https://avatars.githubusercontent.com/u/7936820?v=4" alt="Route4Me Logo" />
Expand Down
4 changes: 4 additions & 0 deletions apps/dev/nextjs/.env.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ AUTH_TWITTER_SECRET=
AUTH_WIKIMEDIA_ID=
AUTH_WIKIMEDIA_SECRET=

AUTH_FRONTEGG_ID=
AUTH_FRONTEGG_SECRET=
AUTH_FRONTEGG_ISSUER=

# Yandex OAuth. new app -> https://oauth.yandex.com/client/new/id
AUTH_YANDEX_ID=
AUTH_YANDEX_SECRET=
Expand Down
6 changes: 5 additions & 1 deletion apps/dev/nextjs/app/client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ export default function Client() {
) : (
<>
<button onClick={() => signIn("github")}>Sign in GitHub</button>
<button onClick={() => signIn("credentials", {})}>
<button
onClick={async () => {
await signIn("webauthn", {})
}}
>
Sign in Credentials
</button>
</>
Expand Down
4 changes: 3 additions & 1 deletion apps/dev/nextjs/auth.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import NextAuth from "next-auth"
import type { NextAuthConfig } from "next-auth"
import Credentials from "next-auth/providers/credentials"
import Keycloak from "next-auth/providers/keycloak"
import GitHub from "next-auth/providers/github"

// import { PrismaClient } from "@prisma/client"
// import { PrismaAdapter } from "@auth/prisma-adapter"
Expand Down Expand Up @@ -66,8 +66,10 @@ export const { handlers, auth, signIn, signOut, unstable_update } = NextAuth({
}
},
}),
GitHub,
Keycloak,
],

callbacks: {
jwt({ token, trigger, session }) {
if (trigger === "update") token.name = session.user.name
Expand Down
2 changes: 1 addition & 1 deletion apps/examples/nextjs/app/api/protected/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ export const GET = auth((req) => {
}

return Response.json({ message: "Not authenticated" }, { status: 401 })
}) as any // TODO: Fix `auth()` return type
})
24 changes: 8 additions & 16 deletions apps/examples/nextjs/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import { createStorage } from "unstorage"
import memoryDriver from "unstorage/drivers/memory"
import vercelKVDriver from "unstorage/drivers/vercel-kv"
import { UnstorageAdapter } from "@auth/unstorage-adapter"
import type { NextAuthConfig } from "next-auth"

const storage = createStorage({
driver: process.env.VERCEL
Expand All @@ -49,11 +48,12 @@ const storage = createStorage({
: memoryDriver(),
})

const config = {
export const { handlers, auth, signIn, signOut } = NextAuth({
debug: !!process.env.AUTH_DEBUG,
theme: { logo: "https://authjs.dev/img/logo-sm.png" },
adapter: UnstorageAdapter(storage),
providers: [
Apple({ redirectProxyUrl: "" }),
Apple,
// Atlassian,
Auth0,
AzureB2C,
Expand Down Expand Up @@ -97,9 +97,7 @@ const config = {
Vipps({
issuer: "https://apitest.vipps.no/access-management-1.0/access/",
}),
WorkOS({
connection: process.env.AUTH_WORKOS_CONNECTION!,
}),
WorkOS({ connection: process.env.AUTH_WORKOS_CONNECTION! }),
Zoom,
],
basePath: "/auth",
Expand All @@ -118,19 +116,13 @@ const config = {
return token
},
async session({ session, token }) {
if (token?.accessToken) {
session.accessToken = token.accessToken
}
if (token?.accessToken) session.accessToken = token.accessToken

return session
},
},
experimental: {
enableWebAuthn: true,
},
debug: process.env.NODE_ENV !== "production" ? true : false,
} satisfies NextAuthConfig

export const { handlers, auth, signIn, signOut } = NextAuth(config)
experimental: { enableWebAuthn: true },
})

declare module "next-auth" {
interface Session {
Expand Down
2 changes: 1 addition & 1 deletion apps/examples/sveltekit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"devDependencies": {
"@sveltejs/adapter-auto": "3.2.0",
"@sveltejs/kit": "2.5.7",
"@sveltejs/kit": "2.8.3",
"@sveltejs/vite-plugin-svelte": "^3.1.0",
"svelte": "4.2.19",
"svelte-check": "3.6.9",
Expand Down
18 changes: 0 additions & 18 deletions docs/components/Footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,24 +58,6 @@ export function Footer({ className = "" }) {
Discord Community
</a>
</li>
<li>
<a
className="flex items-center gap-1 text-current"
target="_blank"
rel="noopener noreferrer"
title="vercel.com homepage"
href="https://vercel.com?utm_source=authjs&utm_campaign=oss"
>
<span>Powered by</span>
<svg height={20} viewBox="0 0 283 64" fill="none">
<title>Vercel</title>
<path
fill="currentColor"
d="M141.04 16c-11.04 0-19 7.2-19 18s8.96 18 20 18c6.67 0 12.55-2.64 16.19-7.09l-7.65-4.42c-2.02 2.21-5.09 3.5-8.54 3.5-4.79 0-8.86-2.5-10.37-6.5h28.02c.22-1.12.35-2.28.35-3.5 0-10.79-7.96-17.99-19-17.99zm-9.46 14.5c1.25-3.99 4.67-6.5 9.45-6.5 4.79 0 8.21 2.51 9.45 6.5h-18.9zM248.72 16c-11.04 0-19 7.2-19 18s8.96 18 20 18c6.67 0 12.55-2.64 16.19-7.09l-7.65-4.42c-2.02 2.21-5.09 3.5-8.54 3.5-4.79 0-8.86-2.5-10.37-6.5h28.02c.22-1.12.35-2.28.35-3.5 0-10.79-7.96-17.99-19-17.99zm-9.45 14.5c1.25-3.99 4.67-6.5 9.45-6.5 4.79 0 8.21 2.51 9.45 6.5h-18.9zM200.24 34c0 6 3.92 10 10 10 4.12 0 7.21-1.87 8.8-4.92l7.68 4.43c-3.18 5.3-9.14 8.49-16.48 8.49-11.05 0-19-7.2-19-18s7.96-18 19-18c7.34 0 13.29 3.19 16.48 8.49l-7.68 4.43c-1.59-3.05-4.68-4.92-8.8-4.92-6.07 0-10 4-10 10zm82.48-29v46h-9V5h9zM36.95 0L73.9 64H0L36.95 0zm92.38 5l-27.71 48L73.91 5H84.3l17.32 30 17.32-30h10.39zm58.91 12v9.69c-1-.29-2.06-.49-3.2-.49-5.81 0-10 4-10 10V51h-9V17h9v9.2c0-5.08 5.91-9.2 13.2-9.2z"
/>
</svg>
</a>
</li>
</ul>
</div>
<div className="flex flex-col">
Expand Down
Loading

0 comments on commit f47fd20

Please sign in to comment.