When using an auth provider to create a user how can I set the username equal to the email?

System Information
  • Strapi Version: 3.4.6
  • Operating System: Mac
  • Database: Postgres
  • Node Version: >=10.16.0 <=14.x.x
  • NPM Version: >=6.0.0
  • Yarn Version:

I got this to work by adding backend/app/extensions/users-permissions/services/Providers.js coping content from https://raw.githubusercontent.com/strapi/strapi/master/packages/strapi-plugin-users-permissions/services/Providers.js and changing the providers to use const username = body.email;

Is this the correct way?