bjerkio/oidc-react

onBeforeSignIn not invoked when calling signIn

pseudoramble opened this issue · 4 comments

I noticed that when signIn is called directly, as opposed to say autoSignIn the onBeforeSignIn hook is not called. I think it's inconsistent to do it this way since it seems like the kind of thing that should be always called regardless of when or how sign in is occurring.

Looking back at old issues though, I did notice #36 and #447 which seem to point to using oidc-client and the back end to handle this kind of work. I wasn't aware of this as an option until I came across this issue.

So two ideas I had for this:

  1. Call onBeforeSignIn whenever the signIn function is called.
  2. Consider deprecating onBeforeSignIn for future releases and encourage people to use these other options.

I'm partial to the first option because it's less work for me 😆 but I figured I'd at least write this down as a potential issue.

+1

I agree, we should look for a more consistent way.

I try to think that oidc-react should have more focus on developer experience than most features/expandability. I have to think about what option to go forward with, not too sure 🤷‍♂️

@cobraz any news on this ?

This is still an issue, and I should be able to resolve it as part of some additional cleanup.