benvanstaveren / Mojolicious-Plugin-Authentication

A plugin to make authentication a bit easier
http://search.cpan.org/dist/Mojolicious-Plugin-Authentication/
Other
20 stars 17 forks source link

Async user lookup support? #30

Closed mohawk2 closed 4 years ago

mohawk2 commented 4 years ago

I really like the idea of this module, but think it needs to support async user lookup etc.

Are you open to a PR for that?

jjatria commented 4 years ago

As long as this is something that plays nice with the rest of the module, I see no reason to opposed it, but it's hard to tell without a clearer idea of what you have in mind. Feel free to put some ideas to paper, and thanks for the interest!

mohawk2 commented 4 years ago

The outline would be to simply add to all the methods you have, the same but with _p appended, that returned promises. The tests would obviously all still work with the synchronous methods (so 100% backwards compatible), but would be generalised to make it easier to also test the async ones.

Thank you for coming back on this! I believe the easiest way forward is for me to simply create a PR and you can then steer it so that it is to your taste :-)

jjatria commented 4 years ago

Ah, yeah, that would also fit with the _p functions that are everywhere else in Mojolicious (and which I don't think existed when this module was first written).

Please do send in that PR, and we can take it from there :slightly_smiling_face: