Open josephguillaume opened 3 years ago
The "session" event is emitted by handleRedirect, which is never called in the main window with the popup workflow. The callback provided to onSession is therefore never called.
"session"
handleRedirect
onSession
https://github.com/solid/solid-auth-fetcher/blob/877dd07e8a0ecd00121414b21d1aeffbb72660d0/src/AuthFetcher.ts#L121
One option would be to emit a "session" event after the session is created in PopUpLoginHandler https://github.com/solid/solid-auth-fetcher/blob/877dd07e8a0ecd00121414b21d1aeffbb72660d0/src/login/popUp/PopUpLoginHandler.ts#L73
PopUpLoginHandler
As a workaround, when using the popup workflow, the onSession callback can be called on completion of login, e.g.
solidAuthFetcher.login({ oidcIssuer: "https://identityProvider.com", popUp: true, popUpRedirectPath: "/popup.html" }).then( session => console.log(session.webId) )
The
"session"
event is emitted byhandleRedirect
, which is never called in the main window with the popup workflow. The callback provided toonSession
is therefore never called.https://github.com/solid/solid-auth-fetcher/blob/877dd07e8a0ecd00121414b21d1aeffbb72660d0/src/AuthFetcher.ts#L121
One option would be to emit a "session" event after the session is created in
PopUpLoginHandler
https://github.com/solid/solid-auth-fetcher/blob/877dd07e8a0ecd00121414b21d1aeffbb72660d0/src/login/popUp/PopUpLoginHandler.ts#L73As a workaround, when using the popup workflow, the onSession callback can be called on completion of login, e.g.