mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-28 03:43:28 +10:00
Add user id to logger
This commit is contained in:
parent
5bf9d0f072
commit
796bf17c93
3 changed files with 7 additions and 1 deletions
|
|
@ -9,6 +9,7 @@ import { withFlattenedRoutes, withViewport } from '../../util/contextHelpers';
|
|||
import { parse, stringify } from '../../util/urlHelpers';
|
||||
import { createResourceLocatorString, pathByRouteName } from '../../util/routes';
|
||||
import * as propTypes from '../../util/propTypes';
|
||||
import { clearUserId } from '../../util/log';
|
||||
import {
|
||||
Button,
|
||||
IconEmailAttention,
|
||||
|
|
@ -145,6 +146,9 @@ class TopbarComponent extends Component {
|
|||
window.location = path;
|
||||
}
|
||||
|
||||
// clear user id from logger
|
||||
clearUserId();
|
||||
|
||||
// TODO: show flash message
|
||||
console.log('logged out'); // eslint-disable-line
|
||||
});
|
||||
|
|
|
|||
|
|
@ -160,7 +160,6 @@ export class SearchPageComponent extends Component {
|
|||
sendVerificationEmailError,
|
||||
onResendVerificationEmail,
|
||||
} = this.props;
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { boundsChanged, page, ...searchInURL } = parse(location.search, {
|
||||
latlng: ['origin'],
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import { authInfo } from './Auth.duck';
|
||||
import { updatedEntities, denormalisedEntities } from '../util/data';
|
||||
import { TX_TRANSITION_PREAUTHORIZE } from '../util/propTypes';
|
||||
import { setUserId } from '../util/log';
|
||||
|
||||
// ================ Action types ================ //
|
||||
|
||||
|
|
@ -337,6 +338,8 @@ export const fetchCurrentUser = () =>
|
|||
const entities = updatedEntities({}, response.data);
|
||||
const denormalised = denormalisedEntities(entities, 'current-user', [currentUserId]);
|
||||
const currentUser = denormalised[0];
|
||||
// set current user id to the logger
|
||||
setUserId(currentUser.id);
|
||||
dispatch(currentUserShowSuccess(currentUser));
|
||||
return currentUser;
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue