Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
};
const sendEvents = () => {
const config = Analytics.configure();
if (!endpointUpdated && config['autoSessionRecord']) {
Analytics.updateEndpoint({ immediate: true }).catch(e => {
logger.debug('Failed to update the endpoint', e);
});
endpointUpdated = true;
}
Analytics.autoTrack('session', {
enable: config['autoSessionRecord']
});
};
Hub.listen('auth', listener);
Hub.listen('storage', listener);
Hub.listen('analytics', listener);
constructor(props) {
super(props);
this.signOut = this.signOut.bind(this);
Hub.listen('auth', this)
this.onHubCapsule = this.onHubCapsule.bind(this)
this.state = {};
}
function listen(authState: Subject) {
const config = Amplify.configure(null);
if (_.has(config, 'Auth.oauth')) {
Hub.listen(
'auth',
{
onHubCapsule: capsule => {
const { channel, payload } = capsule;
if (channel === 'auth') {
const { username } = payload.data;
logger.debug('authentication oauth event', payload);
authState.next({ state: payload.event, user: { username } });
}
},
},
'angularAuthListener'
);
}
}
const sendEvents = () => {
const config = Analytics.configure();
if (!endpointUpdated && config['autoSessionRecord']) {
Analytics.updateEndpoint({ immediate: true }).catch(e => {
logger.debug('Failed to update the endpoint', e);
});
endpointUpdated = true;
}
Analytics.autoTrack('session', {
enable: config['autoSessionRecord']
});
};
Hub.listen('auth', listener);
Hub.listen('storage', listener);
Hub.listen('analytics', listener);
constructor(props) {
super(props);
this.handleStateChange = this.handleStateChange.bind(this);
this.handleAuthEvent = this.handleAuthEvent.bind(this);
this.onHubCapsule = this.onHubCapsule.bind(this);
this._initialAuthState = this.props.authState || 'signIn';
this.state = { authState: 'loading' };
Hub.listen('auth', this);
}
const sendEvents = () => {
const config = Analytics.configure();
if (!endpointUpdated && config['autoSessionRecord']) {
Analytics.updateEndpoint({ immediate: true }).catch(e => {
logger.debug('Failed to update the endpoint', e);
});
endpointUpdated = true;
}
Analytics.autoTrack('session', {
enable: config['autoSessionRecord']
});
};
Hub.listen('auth', listener);
Hub.listen('storage', listener);
Hub.listen('analytics', listener);
};
const sendEvents = () => {
const config = Analytics.configure();
if (!endpointUpdated && config['autoSessionRecord']) {
Analytics.updateEndpoint({ immediate: true }).catch(e => {
logger.debug('Failed to update the endpoint', e);
});
endpointUpdated = true;
}
Analytics.autoTrack('session', {
enable: config['autoSessionRecord'],
});
};
Hub.listen('auth', listener);
Hub.listen('storage', listener);
Hub.listen('analytics', listener);
constructor(props) {
super(props);
this.handlePick = this.handlePick.bind(this);
this.handleClick = this.handleClick.bind(this);
this.list = this.list.bind(this);
this.marshal = this.marshal.bind(this);
const theme = this.props.theme || AmplifyTheme;
this.state = {
theme,
items: [],
ts: new Date().getTime()
};
Hub.listen('window', this, 'S3Album');
}
constructor(props) {
super(props);
this.handleStateChange = this.handleStateChange.bind(this);
this.handleAuthEvent = this.handleAuthEvent.bind(this);
this.onHubCapsule = this.onHubCapsule.bind(this);
this._initialAuthState = this.props.authState || 'signIn';
this.state = { authState: 'loading' };
Hub.listen('auth', this.onHubCapsule);
}