Closed vainu-arto closed 6 months ago
As user ID is stored as a string in the database, it should really be a string. I think https://github.com/python-social-auth/social-core/pull/905 would be the way to address this.
As user ID is stored as a string in the database, it should really be a string. I think python-social-auth/social-core#905 would be the way to address this.
That looks good to me, a nicer developer experience than requiring that each backend does that itself.
Expected behaviour
We have a client implementation for an OAuth2 provider that returns the user id as an integer instead of a string. Before commit 31c3e0c7edb187004d8abbde7e9c4f7ef9098138 this worked seamlessly.
Actual behaviour
After that commit the fact that the user id is a duplicate isn't detected until actually attempting to save it to the database (as a violation of the unique constraint).
What are the steps to reproduce this issue?
Input a duplicate user_id as an integer.
Any logs, error output, etc?
Any other comments?
Is the correct solution to restore the type conversion to the library code (perhaps just by doing str(uid) in get_social_auth()), or is it to codify that BaseAuth.get_user_id() must always return a string?