11"use client" ;
22
33import { useEffect , useState } from "react" ;
4- import {
5- getDefaultSession ,
6- handleIncomingRedirect ,
7- } from "@inrupt/solid-client-authn-browser" ;
4+ import { handleIncomingRedirect } from "@inrupt/solid-client-authn-browser" ;
5+ import { getSession } from "../lib/helpers" ;
86import LoginPage from "./LoginPage" ;
97import LoadingSpinner from "./shared/LoadingSpinner" ;
108import ErrorDisplay from "./shared/ErrorDisplay" ;
@@ -29,7 +27,7 @@ export default function AuthWrapper({ children }: AuthWrapperProps) {
2927 } ) ;
3028
3129 // Get the session instance after handling redirect
32- const session = getDefaultSession ( ) ;
30+ const session = getSession ( ) ;
3331
3432 let isLoggedIn = session . info . isLoggedIn && ! ! session . info . webId ;
3533
@@ -66,7 +64,7 @@ export default function AuthWrapper({ children }: AuthWrapperProps) {
6664 const redirectInfo = await handleIncomingRedirect ( {
6765 restorePreviousSession : true ,
6866 } ) ;
69- const session = getDefaultSession ( ) ;
67+ const session = getSession ( ) ;
7068 if ( session . info . isLoggedIn ) {
7169 setIsAuthenticated ( true ) ;
7270 setError ( null ) ;
@@ -87,7 +85,7 @@ export default function AuthWrapper({ children }: AuthWrapperProps) {
8785
8886 handleIncomingRedirect ( { restorePreviousSession : true } )
8987 . then ( ( ) => {
90- const session = getDefaultSession ( ) ;
88+ const session = getSession ( ) ;
9189 setIsAuthenticated ( session . info . isLoggedIn ) ;
9290 } )
9391 . catch ( ( err ) => {
0 commit comments