dwightwatson/autologin — pull request #7 by ilesinge (2014-10-03 07:43:19+00:00)
Title: Prevent error when trying to login a non-existent user.

If the user has been deleted between the autologin link generation and the link usage, this results in the following error and provoking a 500:
"Argument 1 passed to Illuminate\Auth\Guard::login() must implement interface Illuminate\Auth\UserInterface, null given, called in .../vendor/laravel/framework/src/Illuminate/Auth/Guard.php on line 462"

This modification suppresses the error and redirects the not-found user to the home page (same as invalid token) by first checking if the user exists (retrieveById) before trying to login.

A similar (simpler) modification could be done on SentryAuthenticationProvider but I don't have any environment to test it on.