VirgilSecurity / virgil-e3kit-js

E3Kit is a security framework that simplifies work with Virgil services and presents the easiest way to add full end-to-end security to your chat application to become HIPAA and GDPR compliant and more.
https://virgilsecurity.com/e3kit/
BSD 3-Clause "New" or "Revised" License
58 stars 19 forks source link

authorization token is invalid or contains invalid field(s) #132

Closed davidbiller closed 3 years ago

davidbiller commented 3 years ago

Get this error:

virgil token: eyJhbGciOiJWRURTNTEyIiwia2lkIjoiMTZlNjE4NjkxMzBiZWQ1N2ZiMmVkMThlYzJhOGY5YWMiLCJ0eXAiOiJKV1QiLCJjdHkiOiJ2aXJnaWwtand0O3Y9MSJ9.eyJpc3MiOiJ2aXJnaWwtY2hhdC1pdDJtYXRjaCIsInN1YiI6ImlkZW50aXR5LTE0IiwiaWF0IjoxNjA2MTM0NDMyLCJleHAiOjE2MDYxMzU2MzJ9.MFEwDQYJYIZIAWUDBAIDBQAEQC76zvhflnZyyc0DkPNYussdDl-Mz3IQnZXgunZEOtdephdaXDJmrPEU0Tz06Qg90bLgu5FBnwKO2Zb3jvRx-AU

[Mon Nov 23 2020 13:27:15.225] WARN Possible Unhandled Promise Rejection (id: 1): VirgilHttpError: authorization token is invalid or contains invalid field(s)

async function initVirgil() {
    const foo = EThree.initialize(() => getVirgilToken(), {
      AsyncStorage,
    });
    console.log(foo);
    const eThree = await foo;
    const reg = await eThree.register();
    console.log('await eThree.register();', reg);
  }
async function getVirgilToken() {
    const {id} = company;
    let res;
    const instance = functions().httpsCallable('virgil');
    try {
      res = await instance({
        uid: id,
      });
      console.log('virgil token', res.data);
      return res.data;
    } catch (e) {
      console.error('VIRGIL ERROR', e);
    }
  }
davidbiller commented 3 years ago

Bildschirmfoto 2020-11-23 um 13 33 27