File tree Expand file tree Collapse file tree 2 files changed +3
-23
lines changed Expand file tree Collapse file tree 2 files changed +3
-23
lines changed Original file line number Diff line number Diff line change @@ -19,18 +19,18 @@ export default async function middleware(req: NextRequest) {
1919
2020 // 3. Get the session from the cookie
2121 const sessionCookie = req . cookies . get ( "id" ) ;
22- const validSession = sessionCookie ?. value ;
22+ const isValidSession = sessionCookie ?. value ;
2323
2424 // 4. Redirect to / if the user is not authenticated
2525 // 4b. TODO: Check session validity/expiration?
26- if ( isProtectedRoute && ! validSession ) {
26+ if ( isProtectedRoute && ! isValidSession ) {
2727 return NextResponse . redirect ( new URL ( "/" , req . nextUrl ) ) ;
2828 }
2929
3030 // 5. Redirect to /dashboard if the user is authenticated
3131 if (
3232 isPublicRoute &&
33- validSession &&
33+ isValidSession &&
3434 ! req . nextUrl . pathname . startsWith ( "/dashboard" )
3535 ) {
3636 return NextResponse . redirect ( new URL ( "/dashboard" , req . nextUrl ) ) ;
Original file line number Diff line number Diff line change @@ -69,26 +69,6 @@ export function filterAndSortCoachingSessions(
6969 return filteredSessions ;
7070}
7171
72- // export function sortCoachingSessionArray(
73- // sessions: CoachingSession[],
74- // order: SortOrder
75- // ): CoachingSession[] {
76- // if (order == SortOrder.Ascending) {
77- // sessions.sort(
78- // (a, b) =>
79- // new Date(a.date.toString()).getTime() -
80- // new Date(b.date.toString()).getTime()
81- // );
82- // } else if (order == SortOrder.Descending) {
83- // sessions.sort(
84- // (a, b) =>
85- // new Date(b.date.toString()).getTime() -
86- // new Date(a.date.toString()).getTime()
87- // );
88- // }
89- // return sessions;
90- // }
91-
9272export function getCoachingSessionById (
9373 id : string ,
9474 sessions : CoachingSession [ ]
You can’t perform that action at this time.
0 commit comments