gofr
gofr copied to clipboard
Error Authorising while using EnableBasicAuthwithValidator
Describe the bug Error while Authorising, using EnableBasicAuthwithValidator. Returns 401, instead of 200.
To Reproduce
- Create a function of signature : func(c *container.Container, username string, password string) bool
- Pass it while enabling app.EnableBasicAuthwithValidator(validatefunc).
- Create a mock request and add correct base64 encoded Authorisation header with "Basic " concatenated such that validateFunc function will return true while the check.
- hit the request and we get 401 instead of 200.
Expected behavior the validateCredentials function in basic_auth.go must be refactored to handle this use case.