You can try something like this
var access_token = driver.findElement(webdriver.By.name("AccToken"))
var access_token_getTextFunction = function() {
access_token.getText().then(function(value) {
console.log(value);
return value;
});
}
Than you can call this function where you want to get the value..