D8 - Programmatically hack(login) into Drupal 8 - Custom Login
Here you go - For who ever(developer) think to force login as administrator.
$user = \Drupal\user\Entity\User::load(1);
user_login_finalize($user);
Add the above code in *.theme file in current/default site theme.
$user = \Drupal\user\Entity\User::load(1);
user_login_finalize($user);
Add the above code in *.theme file in current/default site theme.
Comments