diff --git a/wp_oauth_backend/wp_oauth.py b/wp_oauth_backend/wp_oauth.py index 1475aaa..0035827 100644 --- a/wp_oauth_backend/wp_oauth.py +++ b/wp_oauth_backend/wp_oauth.py @@ -58,9 +58,12 @@ class WPOAuth2(BaseOAuth2): user_roles = response.get('user_roles', []) super_user = 'administrator' in user_roles + # create a unique but repeatable username + username = response.get('user_login') + '_' + response.get('ID') + user_details = { 'id': int(response.get('ID')), - 'username': response.get('user_login'), + 'username': username, 'email': response.get('user_email'), 'first_name': first_name, 'last_name': last_name,