window.location = href;
                        },
                        editProfile: function() {
                            href = "<?php 
    echo admin_url('profile.php');
    ?>
";
                            window.location = href;
                        }
                    });

            <?php 
    if (is_user_logged_in()) {
        ?>
                        auth.authenticate({livefyre: "<?php 
        echo esc_js(Livefyre_Apps::generate_wp_user_token());
        ?>
"});
            <?php 
    }
    ?>
                    window.authDelegate = auth.delegate;
                });
            }
            livefyre_auth_loaded = true;
        };
    </script>
<?php 
} elseif (get_option('livefyre_apps-auth_type') === 'auth_delegate') {
    ?>
    <script type="text/javascript">