The issue with the provided code is that the validation is being performed before the user credentials are checked. This means that if the validation fails, the user credentials will not even be checked. To fix this, the validation should be performed after the user credentials are checked. Here's an updated version of the code:
Hello @wizard2000,
for me, as a beginner, this is a very interesting question. Did you do what Lary "Quickdraw" A.I. suggested and can you tell us more? You added this code to the boot method of the FortifyServiceProvider before this code: