react-social-login icon indicating copy to clipboard operation
react-social-login copied to clipboard

User already connected

Open ErAz7 opened this issue 3 years ago • 6 comments

Hey I don't really understand why this line exists: https://github.com/deepakaggarwal7/react-social-login/blob/2cc418649e8ed90a16c8f4c4fdfae4fb2f48b19d/src/index.js#L151

there are many cases that this behavior will cause issues e.g. social token is caught but attempt to call app's login API fails and user wants to trigger login again (and maybe with another account) or let's say user uses a FB account that has no email and we need email for BE; so we ask user for email after fetching FB profile (and token) and then call app's login API, now assume user don't want to enter email and wants to use another FB account but if click on button again will get error (or nothing happens if no failure callback)

ErAz7 avatar Aug 13 '20 23:08 ErAz7

@ErAz7 Did you find any solution regarding this? I am also facing same issue.

mvtdev1050 avatar Sep 15 '20 12:09 mvtdev1050

Given that it is wrapped inside "else if (this.state.isLoaded && this.state. isConnected) {" which will be true only when user has already successfully connected, do you see a concern?

On Tue, Sep 15, 2020 at 6:03 PM mvtdev1050 [email protected] wrote:

Did you find any solution regarding this? I am also facing issue.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/deepakaggarwal7/react-social-login/issues/169#issuecomment-692684550, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEU7A3E63J6ET72LBOTETPLSF5NK5ANCNFSM4P65WH6Q .

deepakaggarwal7 avatar Sep 17 '20 04:09 deepakaggarwal7

sorry for this huge delay @deepakaggarwal7 yes still some remain, I think I didn't explain properly. hope this is more clear:

so main issue is when user wants to use another account after login failure or for any other reason. let's say he tries a gmail and it fails on our BE, so he may want to try another gmail but since he's already connected to a gmail, wont be able to chnage (User already connected)

ErAz7 avatar Jan 16 '21 16:01 ErAz7

bump

dwjiang avatar Feb 08 '21 09:02 dwjiang

Let me explain my understanding. Feel free to correct me.

User uses Google Authentication successfully in which case SDK will mark it logged in. However, there's custom logic (for example the domain used is incorrect). In that case you want user to be able to login again but the SDK would have already marked user as logged in (as basic Google authentication was correct).

In this case, can you try calling logout explicitly? For example, onSuccessfulLogin, you can execute custom logic and if it fails you can call logout.

deepakaggarwal7 avatar Feb 23 '21 05:02 deepakaggarwal7

In this case, can you try calling logout explicitly? For example, onSuccessfulLogin, you can execute custom logic and if it fails you can call logout.

@deepakaggarwal7 when I tried to call ref.logout, it said User not connected

hdminh247 avatar Mar 11 '21 05:03 hdminh247