public/js/music_playlist.js
/**
 * Handle user authorization logout form submit button.
 */
Handle user authorization logout form submit button.
Handle user authorization logout form submit button .
function sendAuthUserLogoutForm() {
    var token = document.getElementById('formAuthUserLogoutToken');
    var tokenValue = token.value;
    var status = document.getElementById('formAuthUserLogoutStatus');
    if (tokenValue == '') {
        status.innerText = 'Token field is empty!';
        return;
    }
    var url = base_url + "/api/auth/logout";
    fetch(url, {
        credentials: "same-origin",
        method: 'GET',
        headers:{
            'Content-Type': 'application/json',
            'X-Requested-With': 'XMLHttpRequest',
            'X-CSRF-TOKEN': getCSRFToken(),
            'Authorization': 'Bearer ' + tokenValue
        }
    })
    .then(function(response) {
        return response.json();
    })
    .then(function(json) {
        status.innerText = JSON.stringify(json);
    });           
}
function sendAuthUserLogoutForm ( ) { var token = document . getElementById ( 'formAuthUserLogoutToken' ) ; var tokenValue = token . value ; var status = document . getElementById ( 'formAuthUserLogoutStatus' ) ; if ( tokenValue == '' ) { status . innerText = 'Token field is empty!' ; return ; } var url = base_url + "/api/auth/logout" ; fetch ( url , { credentials : "same-origin" , method : 'GET' , headers : { 'Content-Type' : 'application/json' , 'X-Requested-With' : 'XMLHttpRequest' , 'X-CSRF-TOKEN' : getCSRFToken ( ) , 'Authorization' : 'Bearer ' + tokenValue } } ) . then ( function ( response ) { return response . json ( ) ; } ) . then ( function ( json ) { status . innerText = JSON . stringify ( json ) ; } ) ; }
Handle user authorization logout form submit button.
Handle user authorization logout form submit button .