wallet icon indicating copy to clipboard operation
wallet copied to clipboard

Ensure dev mode works with GNAP

Open birtony opened this issue 2 years ago • 1 comments

  • [ ] Figure out a way to run tests without requiring generating test keys in https://github.com/trustbloc/wallet/pull/1784
  • [ ] Check if auth returns bootstrap data in dev mode and fix any issues
  • [ ] Analyze if we need to hard code token expiry used in wallet unlocking for dev mode, or whether we can use the value from bootstrap data returned by auth

birtony avatar Jul 15 '22 17:07 birtony

  • Firstly, the auth server url for dev mode seems to be broken. I am unable to reach https://localhost:8044, and replacing agentOpts['hub-auth-url'] = 'https://localhost:8044'; -> agentOpts['hub-auth-url'] = 'https://auth.trustbloc.local:8044'; in options.js gets me past the first error and to the login page.
  • Secondly, I tried removing the following check for production before updating profileOpts with data from getBootstrapData,
         if (process.env.NODE_ENV === 'production') {
            const newOpts = await getBootstrapData(agentOpts, hubAuthURL, dispatch, accessToken);

            if (newOpts?.newAgentOpts) {
              Object.assign(agentOpts, newOpts?.newAgentOpts);
              commit('updateAgentOpts', agentOpts, { root: true });
            }
            if (newOpts?.newProfileOpts) {
              Object.assign(profileOpts, newOpts?.newProfileOpts);
              commit('updateProfileOpts', profileOpts, { root: true });
            }
          }
  • but after that call, profileOps.bootstrap.data.user is empty, although user is set with hardcoded values in initOpts. Maybe it is related to fact that Object.assign cannot deal with nested values and overrides the data.user and data.tokenExpiry that was set from before, I'm not 100% sure.

HeidiHan0000 avatar Aug 24 '22 20:08 HeidiHan0000