mirror of
https://github.com/LukeHagar/better-auth.git
synced 2025-12-09 20:27:44 +00:00
Merge remote-tracking branch 'upstream' into v1.3.8-staging
This commit is contained in:
@@ -66,6 +66,17 @@ import { auth } from "../../../lib/auth";
|
||||
export const GET = oAuthDiscoveryMetadata(auth);
|
||||
```
|
||||
|
||||
### OAuth Protected Resource Metadata
|
||||
|
||||
Add a route to expose protected resource metadata for MCP clients:
|
||||
|
||||
```ts title=".well-known/oauth-authorization-server/route.ts"
|
||||
import { oAuthProtectedResourceMetadata } from "better-auth/plugins";
|
||||
import { auth } from "@/lib/auth";
|
||||
|
||||
export const GET = oAuthProtectedResourceMetadata(auth);
|
||||
```
|
||||
|
||||
### MCP Session Handling
|
||||
|
||||
You can use the helper function `withMcpAuth` to get the session and handle unauthenticated calls automatically.
|
||||
|
||||
Reference in New Issue
Block a user