Skip to content

Commit

Permalink
minor change
Browse files Browse the repository at this point in the history
  • Loading branch information
powerful23 committed Jan 17, 2018
1 parent 8ba7781 commit 660e0f8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
10 changes: 5 additions & 5 deletions packages/aws-amplify/lib/Analytics/Analytics.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/aws-amplify/lib/Analytics/Analytics.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions packages/aws-amplify/src/Analytics/Analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ export default class AnalyticsClass {
* check if current crednetials exists
*/
_ensureCredentials() {

const conf = this._config;
// commented
// will cause bug if another user logged in without refreshing page
// if (conf.credentials) { return Promise.resolve(true); }
Expand All @@ -307,10 +307,11 @@ export default class AnalyticsClass {
.then(credentials => {
const cred = Auth.essentialCredentials(credentials);

this._config.credentials = cred;
this._config.endpointId = this._config.credentials.identityId;
logger.debug('set endpointId for analytics', this._config.endpointId);
logger.debug('set credentials for analytics', this._config.credentials);
conf.credentials = cred;
conf.endpointId = conf.credentials.identityId;

logger.debug('set endpointId for analytics', conf.endpointId);
logger.debug('set credentials for analytics', conf.credentials);

return true;
})
Expand Down

0 comments on commit 660e0f8

Please sign in to comment.