File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -24,17 +24,17 @@ export const getPayloadUser = async <T extends object = User>({
2424 serverUrl = process . env . NEXT_PUBLIC_SERVER_URL ,
2525 userCollectionSlug = "users" ,
2626} : Options = { } ) : Promise < T | null > => {
27+ const requestCookies = await cookies ( ) ;
28+
2729 if ( serverUrl === undefined ) {
2830 throw new Error (
29- "getPayloadUser requires a server URL to be provided, either as an option or in the 'NEXT_PUBLIC_SERVER_URL' environment variable" ,
31+ "getPayloadUser requires a server URL to be provided, either as an option or as the 'NEXT_PUBLIC_SERVER_URL' environment variable" ,
3032 ) ;
3133 }
3234
33- const cookieStore = await cookies ( ) ;
34-
3535 const meUserReq = await fetch ( `${ serverUrl } /api/${ userCollectionSlug } /me` , {
3636 headers : {
37- Cookie : cookieStore . toString ( ) ,
37+ Cookie : requestCookies . toString ( ) ,
3838 } ,
3939 } ) ;
4040
You can’t perform that action at this time.
0 commit comments