Question

I'm develop the site using Django and am using django social_auth API for social login authentication. Here in my website no need to display the change password option when am login using social account. So how to hide that option when am login with social account. OR If there is any possibility to know whether login using social account or website login. Kindly let me know if you have an idea to solve this issue. Thanking you.

Was it helpful?

Solution

A simple solution (when someone don't know the actual implementation) can be

  1. Create a new table with user as foreign key and one more column with will work as flag for type of authentication.
  2. The flag can be 1 for django user and 2 for social auth user
  3. While creating the user in your system populate this table accordingly.
  4. Hide the option of change the password on the basis of same table.

OTHER TIPS

Check the session value social_auth_last_login_backend, if it's set it will have the last social backend used to login, if it's not set, then it means that the user logged in with non-social auth.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top