Change auto created username pattern

Due to oauth2 configs our users’ usernames emulate the email pattern Home directories reflect the entire email address, i.e.,

I’d prefer to constrain usernames to just the user portion of the mail to the left of @. This would make it easier to login, eliminate uglier urls, etc.

Is there an easy way to achieve this? Does it require extending the User class?

You can subclass your authenticator class, and modify the returned username: