File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
packages/nextjs/src/app-router/server Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -54,16 +54,32 @@ type MachineAuth<T extends TokenType> = (AuthenticatedMachineObject | Unauthenti
54
54
export type AuthOptions = { acceptsToken ?: TokenType | TokenType [ ] | 'any' } ;
55
55
56
56
export interface AuthFn < TRedirect = ReturnType < typeof redirect > > {
57
+ /**
58
+ * @example
59
+ * const authObject = await auth({ acceptsToken: ['session_token', 'api_key'] })
60
+ */
57
61
< T extends TokenType [ ] > (
58
62
options : AuthOptions & { acceptsToken : T } ,
59
63
) : Promise < InferAuthObjectFromTokenArray < T , SessionAuth < TRedirect > , MachineAuth < T [ number ] > > > ;
60
64
65
+ /**
66
+ * @example
67
+ * const authObject = await auth({ acceptsToken: 'session_token' })
68
+ */
61
69
< T extends TokenType > (
62
70
options : AuthOptions & { acceptsToken : T } ,
63
71
) : Promise < InferAuthObjectFromToken < T , SessionAuth < TRedirect > , MachineAuth < T > > > ;
64
72
73
+ /**
74
+ * @example
75
+ * const authObject = await auth({ acceptsToken: 'any' })
76
+ */
65
77
( options : AuthOptions & { acceptsToken : 'any' } ) : Promise < AuthObject > ;
66
78
79
+ /**
80
+ * @example
81
+ * const authObject = await auth()
82
+ */
67
83
( ) : Promise < SessionAuth < TRedirect > > ;
68
84
69
85
/**
You can’t perform that action at this time.
0 commit comments