Hello Everyone I am building a web app implementing the usual registration and logging, decided to use fortify for auth. The implementation went well and all but i noticed something rather disturbing, if the user while registering enters an email address that can't be reached either because it doesn't exist the email verification process returns an http code that is catched by the redirectIfAuthenticated middleware. This then causes an error saying expected http code 250 received code 500.
I am pretty new to laravel so i would like to know if this is just on my part or if there is an effective workaround this. Thanks
Yes this is actually related to the email sending, that is i am still in local setup and i used an smtp server for testing the email verification. When a user logs in with an existing/reachable email address everything works fine and they get the mail, but in the other case i get the error message
Expected response code "250/251/252" but got code "550", with message "550 Unknown recipient".
That error is thrown at the redirectIfAuthenticated middleware when it tries to return the next request.
I would like to know how to effectively handle this. Thanks
@seeker1 Those are SMTP status codes from the mail system – not server error codes or HTTP status codes. SMTP status code 550 (note: 550, not 500!) means that the recipient’s email is invalid, which you already knew, since you’ve discovered it only happens with invalid addresses. That status code is then converted into an exception by Laravel to help you gracefully handle such scenarios.
I don’t know why redirectIfAuthenticated middleware is receiving an SMTP response – that sounds like something is amiss in how you’ve set things up. The actual e-mail sending (including receiving a response from the SMTP server) should be happening either after your middleware has run or in a route that doesn’t have any such middleware (e.g., if you relegate it to a queue).
@Snapey I realize that, but as i just said i only used what came with fortify. I just followed the documentation on how to implement it. After which i noticed this problem.
@amitsolanki24_ If you don't know what's going on, please don't pretend you do while giving advice. It will lead people down the wrong tracks and waste their time. At least add "I think" or something similar to indicate that you're just guessing.