Anonymous User Setting Username

Hello, In my application I'm using the anonymous and username plugins. When I sign in with an anonymous user is there an easy way to set a unique username for the anonymous user which was created. Thanks.
Solution:
Use a hook https://www.better-auth.com/docs/concepts/hooks and then you could use something like uuid or anything similar to generate a collision resistant name....
Hooks | Better Auth
Better Auth Hooks let you customize BetterAuth's behavior
Jump to solution
2 Replies
Solution
lonelyplanet
lonelyplanet2d ago
Use a hook https://www.better-auth.com/docs/concepts/hooks and then you could use something like uuid or anything similar to generate a collision resistant name.
Hooks | Better Auth
Better Auth Hooks let you customize BetterAuth's behavior
MrT Stephens
MrT StephensOP2d ago
Ahh this will do perfectly thanks very much for your help.

Did you find this page helpful?