Added logic to add authentication to user if they already logged in