Closed rickcr closed 12 years ago
Actually this scenario is very unlikely to occur since you wouldn't be showing the connect button for a user who is logged in and already has an account.
In my case I need to handle my check for the user being already tied to a facebook account at a different spot - for the case where they are doing a "sign in and connect" all in one shot... which happens if they try to a signin with facebook but a different facebook account is present (for example their spouse was on the computer) - in this case I prompt them with the join form but also a "Already a member? sign and connect" - at which point I need to do a check if that member already has a facebook account tied to their account.
I'll close this since probably not worth the hassle of implementing at this point (although in general I like interceptors that can abort the process if they return false so might be something to consider in the future.)
I'm also facing the same thing. I don't want the user to connect a facebook or twitter account which is already connected to some other user.
In our application we do not want to allow a user to connect with a different facebook connection if they've already connected previously with a different facebook providerUserId.
I've already had to extend ConnectController for some other purposes so I could accomplish what I need by overriding connect as so:
However, many users might not have a need to really extend ConnectController but they'll probably have created an Interceptor and might be relying on preConnect.
I was thinking why not have preConnect in ConnectController return a boolean and in the preConnect method if any of the interceptor preConnects return a 'false' then you leave preConnect and return false. Within "connect" you'd then halt the oauth stuff if preConnect returned false. So something like: