mardi 12 janvier 2021

Connect additional Social account to logged in user

Currently, I have Google, Github, Twitter account registration/login (merge them by email). But I want to give a currently logged-in user ability to manually connect another social account (with a different email). For authorization, I use JWT and store them in localStorage on frontend.

The problem comes when we redirect user to some of social login providers and when he returns back we don't know who it is. It can be user that connects an additional social account to the main account or a new user that firstly login by some social provider.

What possible solution for getting logged-in user after redirect from Social login provider when using JWT for auth?

or

What best solution for linking social account to existing main account when using JWT for auth?

By "social login provider" I mean Github, Google, Twitter, etc

Aucun commentaire:

Enregistrer un commentaire