Hi,
When I am using this code in a custom module, I am getting below error
"InvalidArgumentException: Cannot redirect to an empty URL. in Symfony\Component\HttpFoundation\RedirectResponse->setTargetUrl() (line 76 of /websites/www/html/drl/vendor/symfony/http-foundation/RedirectResponse.php) #0 /websites/www/html/drl/vendor/symfony/http-foundation/RedirectResponse.php(39): Symfony\Component\HttpFoundation\RedirectResponse->setTargetUrl(NULL) #1 /websites/www/html/drl/sites/grants/themes/grants/grants.theme(1536): Symfony\Component\HttpFoundation\RedirectResponse->__construct(NULL) #2 [internal function]: custom_login_user_login(Object(Drupal\user\Entity\User)) #3 /websites/www/html/drl/core/lib/Drupal/Core/Extension/ModuleHandler.php(402): call_user_func_array('custom_login_us...', Array) #4 /websites/www/html/drl/core/modules/user/user.module(559): Drupal\Core\Extension\ModuleHandler->invokeAll('user_login', Array) #5 /websites/www/html/drl/your_auto_login.php(12): user_login_finalize(Object(Drupal\user\Entity\User)) #6 {main}."
Can you please help me where the thing is going wrong.