Closed Scoottykun closed 3 years ago
thank you for your suggestion.
Sound good to me! Woud you implement and send pull request to this feature ?
Just did a PR #185 :)
Will not have the time any soon to add tests for full coverage, could you do it maybe ?
Merged ~
@Scoottykun I just finished publish package. Please download v1.4.0
thanks!
Hey !
Would be nice to allow function for name & pass option. That way we would be able to adapt credentials for each route or each domain/subdomain if wanted (like in my use case).
I tried to do it myself the hard way like below, and it seems to be working like a charm :
middleware.js
nuxt.config.js
Maybe my case is quite specific with the hostname conditions i added (i need to enable the basic Auth only on a few hostnames that my multisites application can hold), but it would at least give the choice for the developer to set whatever he want as condition within the function (route / domain / ...). As well as the current match option, the classic string format would still be the default usage of the options for the simple use case.
What do you think to this possible improvement ?