-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
better code creation #17
Comments
Maybe that could be temporally fixed by checking if a model already exists. |
I am happy to add this, I am away at the moment but will get to it soon. |
I'd suggest a config type (string, uuid, etc) and a code length. |
@necrogami Added an option to customize the code length in #19 |
I'd be interested in helping with this. I'm keen to have a variable-length (or, at least, longer) invite code, but also (perhaps, and this is personal preference) codes generated along the lines of:
I know these won't be to everyone's tastes but with the 'driver' system you mentioned, they could be potential choices. |
I have a uuid implementation, have a few other things to do on doorman, but hoping to get this to you soon |
@clarkeash Ping me if you need help! |
looking forward to an update! |
Hey Guys, I have been holding off on this as I wanted to get a few other features into doorman, but that doesnt look like I am gonna be able to get those in just yet. There is a UUID implementation committed, just go into I have not tagged a release yet, so it would be great if a few of you could pull in dev-master and give this a try before I tag 2.0.0 Sorry this has taken so long. |
Hey, this is fixed. Sorry it took so long I havent had much time to work on open source lately. |
Right now the code generator just uses Str::random(5) so there is a big chance of duplication
A lot of threads around the web about randomness also this one for laravel laravel/ideas#161
I think a good compromise would be to extract the code generator process into its own class, and give the user an option to override code generator, so if someone is looking for some more secure way can easily use something like uniqueid or some uuid library and add some more options like checking for existence (there is no simple way of generating random string in multiple machines and to make sure there is no duplication without checking the db first)
The text was updated successfully, but these errors were encountered: