anyx / LoginGateBundle

59 stars 23 forks source link

Use username instead of IP #25

Closed antoine1003 closed 4 years ago

antoine1003 commented 4 years ago

Hi, I use your bundle to secure the login page but I encounter an issue : users use a VPN and have the same IP when using the login page. So if one user is blocked every other user is blocked when he try to login after. Is there any wait to check the number of attempts using the username instead of IP?

Thanks !

anyx commented 4 years ago

Hi, @antoine1003 Yes, right now we are aren't saving username in attempts storage. I agree - using combination of username and ip looks like a good idea, but now I don't have match time for work with this bundle.

So maybe later I will add this feature, or you can send PR)

antoine1003 commented 4 years ago

Hey, Thanks for this quick answer ! Okay Ino problem, I'll try to make a PR but I have not really used to symfony bundle. But i'll try :)

antoine1003 commented 4 years ago

Okay, I tried but I have no idea how to make it clean...

anyx commented 4 years ago

So fast) I'll try to find time for it

antoine1003 commented 4 years ago

So cool, thanks you very much 😄 🎉

anyx commented 4 years ago

@antoine1003 just released version 2.0.0-beta with storing usernames in database. Please, look to updated documentation (there is a important part about usernames) and try to use it.

If everything fine, I'll publish major release

antoine1003 commented 4 years ago

@anyx Wow, you're fast :D Thanks a lot, let me try it, I let you know

antoine1003 commented 4 years ago

@anyx I tested the version 2.0.0-beta with the following resolver :

<?php
namespace App\Service;

use Anyx\LoginGateBundle\Service\UsernameResolverInterface;
use Symfony\Component\HttpFoundation\Request;

class UsernameResolver implements UsernameResolverInterface
{
    public function resolve(Request $request)
    {
        $requestData = $request->request->get('_username');

        return $requestData ? $requestData: null;
    }
}

And after some tests everything is working fine ! 👍

anyx commented 4 years ago

@antoine1003 cool, just released 2.0.0 version

antoine1003 commented 4 years ago

@anyx Soo cool thank you for your reactivity! 🙂

anyx commented 4 years ago

@antoine1003 you are welcome!