@@ -186,7 +186,39 @@ export type WithAuthArgs =
186
186
* ---
187
187
* [Documentation](https://next-auth.js.org/configuration/nextjs#middleware)
188
188
*/
189
- export function withAuth ( ...args : WithAuthArgs ) {
189
+
190
+ export function withAuth ( ) : ReturnType < NextMiddlewareWithAuth >
191
+
192
+ export function withAuth (
193
+ req : NextRequestWithAuth
194
+ ) : ReturnType < NextMiddlewareWithAuth >
195
+
196
+ export function withAuth (
197
+ req : NextRequestWithAuth ,
198
+ event : NextFetchEvent
199
+ ) : ReturnType < NextMiddlewareWithAuth >
200
+
201
+ export function withAuth (
202
+ req : NextRequestWithAuth ,
203
+ options : NextAuthMiddlewareOptions
204
+ ) : ReturnType < NextMiddlewareWithAuth >
205
+
206
+ export function withAuth (
207
+ middleware : NextMiddlewareWithAuth ,
208
+ options : NextAuthMiddlewareOptions
209
+ ) : NextMiddlewareWithAuth
210
+
211
+ export function withAuth (
212
+ middleware : NextMiddlewareWithAuth
213
+ ) : NextMiddlewareWithAuth
214
+
215
+ export function withAuth (
216
+ options : NextAuthMiddlewareOptions
217
+ ) : NextMiddlewareWithAuth
218
+
219
+ export function withAuth (
220
+ ...args : WithAuthArgs
221
+ ) : ReturnType < NextMiddlewareWithAuth > | NextMiddlewareWithAuth {
190
222
if ( ! args . length || args [ 0 ] instanceof Request ) {
191
223
// @ts -expect-error
192
224
return handleMiddleware ( ...args )
1 commit comments
vercel[bot] commentedon Jul 12, 2023
Successfully deployed to the following URLs:
next-auth-docs – ./docs
next-auth-docs-git-v4-authjs.vercel.app
www.next-auth.js.org
next-auth-docs-authjs.vercel.app
next-auth.js.org
v4.authjs.dev
next-auth-docs-dun.vercel.app