Cover change username page with e2e tests and fix minor bugs

This commit is contained in:
SleepWalker
2019-12-29 13:57:44 +02:00
parent b2c072e5e1
commit f284664818
15 changed files with 230 additions and 156 deletions

View File

@@ -118,6 +118,21 @@ export function authenticate(
};
}
/**
* Re-fetch user data for currently active account
*/
export function refreshUserData(): ThunkAction<Promise<void>> {
return async (dispatch, getState) => {
const activeAccount = getActiveAccount(getState());
if (!activeAccount) {
throw new Error('Can not fetch user data. No user.id available');
}
await dispatch(authenticate(activeAccount));
};
}
function findAccountIdFromToken(token: string): number {
const { sub, jti } = getJwtPayloads(token);