wallet
wallet copied to clipboard
Ensure dev mode works with GNAP
- [ ] 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
- 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, althoughuser
is set with hardcoded values ininitOpts
. Maybe it is related to fact thatObject.assign
cannot deal with nested values and overrides thedata.user
anddata.tokenExpiry
that was set from before, I'm not 100% sure.