title: how can I get the value of a promise to do the validation on the canActivate?
body: <p>I need to get the value that returns <code>this.isJwtValid()</code> but currently it is not returning the value of the result of the <code>promise</code>, the code continues its flow without stopping there, and I need to get the result of this <code>promise</code> in this line:</p>
  <pre><code>let token = this.isJwtValid() //I need get the value of the promise in this line
  </code></pre>
  <p>to continue with my logic.</p>
  <p>how can I do it?</p>
  <p>this is my code:</p>
  <pre><code>export class verificarToken implements CanActivate {
    constructor(private router: Router, private storage: Storage) {}
  
    async isJwtValid() {
      const jwtToken: any = await this.storage.get(&quot;token&quot;);
      console.log(jwtToken); /// this is showed second
      if (jwtToken) {
        try {
          return JSON.parse(atob(jwtToken.split(&quot;.&quot;)[1]));
        } catch (e) {
          return false;
        }
      }
      return false;
    }
  
    canActivate(ruta: ActivatedRouteSnapshot, estado: RouterStateSnapshot) {
  
      let token = this.isJwtValid(); //I need get the value of token here
      if(token) {
        console.log(token) // this is showed first
        if (ruta.routeConfig.path == &quot;login&quot;) {
          this.router.navigate([&quot;/tabs/tab1&quot;]);
        }
        return true;
      }
      this.storage.clear();
      this.router.navigate([&quot;/login&quot;]);
      return false;
    }
  }
  </code></pre>