iMerica / dj-rest-auth

Authentication for Django Rest Framework
https://dj-rest-auth.readthedocs.io/en/latest/index.html
MIT License
1.64k stars 306 forks source link

When using social login, how to detect on the frontend app if its the first time the user logs in or not? #472

Closed adrenaline681 closed 1 year ago

adrenaline681 commented 1 year ago

I'm using social login with Facebook and Google. On my frontend, I would like to detect if it's the first time the user logs in or not to be able to send them to different routes in each case. How would I approach this?

zafercuz commented 1 year ago

Back on our work project, we had this kind of feature. We just added a column say for an example "first_login (DATETIME)" on the USER table. Then everytime the user logins, we just call that endpoint to check if it's the user's first login or not.

Or I'm totally misunderstanding your question here.