File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66 "main" : " dist/index.js" ,
77 "files" : [" dist" ],
88 "license" : " WTFPL" ,
9- "version" : " 1.0.9 " ,
9+ "version" : " 1.1.0 " ,
1010 "type" : " module" ,
1111 "keywords" : [
1212 " auth" ,
Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ import { type ClientSession } from "./index";
44import { getSession } from "./server-actions" ;
55import { createContext , useContext , type ReactNode } from "react" ;
66import useSWR from "swr" ;
7- import { NextRequest , NextResponse } from "next/server" ;
87
98interface UserInfoContextType {
109 session : ClientSession | null ;
@@ -69,14 +68,14 @@ export function useUserInfo() {
6968}
7069
7170export const createSessionProviderRoute = ( ) => {
72- return async ( _request : NextRequest ) => {
71+ return async ( _request : Request ) => {
7372 const session = await getSession ( ) ;
7473
7574 if ( ! session ) {
76- return NextResponse . json ( { error : "Not logged in" } ) ;
75+ return Response . json ( { error : "Not logged in" } , { status : 401 } ) ;
7776 } else {
7877 const { accessToken, refreshToken, ...clientSession } = session ;
79- return NextResponse . json ( clientSession ) ;
78+ return Response . json ( clientSession ) ;
8079 }
8180 } ;
8281} ;
Original file line number Diff line number Diff line change 11import type { ClientSession } from "./index" ;
22import type { ReactNode } from "react" ;
3- import type { NextRequest } from "next/server" ;
43
54interface UserInfoContextType {
65 session : ClientSession | null ;
@@ -17,5 +16,5 @@ export declare function UserInfoProvider(props: {
1716export declare function useUserInfo ( ) : UserInfoContextType ;
1817
1918export declare function createSessionProviderRoute (
20- request : NextRequest ,
19+ request : Request ,
2120) : Promise < Response > ;
You can’t perform that action at this time.
0 commit comments