Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onSession does not work with popup workflow #23

Open
josephguillaume opened this issue Feb 7, 2021 · 0 comments
Open

onSession does not work with popup workflow #23

josephguillaume opened this issue Feb 7, 2021 · 0 comments

Comments

@josephguillaume
Copy link

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.

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

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)  )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant