Hi all,
This is a comment, not a question.
By default, the scaffold app using Google OAuth stores the user's first name, last name, and email in the auth_user table—but not the profile picture. You can include the profile picture URL with just two lines of code added to common.py:
1. Add the following line
here (adds a new field to
auth_user):
auth = Auth(session, db, define_tables=False)
auth.extra_auth_user_fields = [Field('profile_picture', 'text',
readable=False, writable=False)]
2. Add the following line
here:
from py4web.utils.auth_plugins.oauth2google import OAuth2Google # TESTED
OAuth2Google.maps['profile_picture'] = 'picture'
Once the profile picture URL is stored in auth_user, you can easily use it along with other user information.
-ali