In an angular service, we're exposing a function which provides a token and should be blocking, until the token is loaded.
the critical part in the service
....
    function getToken(){
        tokenPromise().then(
            function(token){ return token;},
            function(error){ return null;}
    }
....
How do I turn this to a blocking function code?
so that service.getToken(); is blocking/synchronious until token is there.
Returning a promise/callback is not a solution.
 
    