Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(authentication): set active datadog rum user (DEV-325) #624

Merged
merged 12 commits into from
Dec 16, 2021
2 changes: 1 addition & 1 deletion src/app/main/services/authentication.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('AuthenticationService', () => {

const cacheServiceSpy = jasmine.createSpyObj('CacheService', ['destroy']);

const datadogRumServiceSpy = jasmine.createSpyObj('datadogRumService', ['removeActiveUser']);
const datadogRumServiceSpy = jasmine.createSpyObj('datadogRumService', ['', 'removeActiveUser']);


beforeEach(() => {
Expand Down
8 changes: 5 additions & 3 deletions src/app/main/services/datadog-rum.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ export class DatadogRumService {
});

// if session is valid: setActiveUser
this._session.isSessionValid().subscribe((response) => {
const session: Session = this._session.getSession();
this.setActiveUser(session.user.name, 'username');
this._session.isSessionValid().subscribe((response: boolean) => {
if (response) {
const session: Session = this._session.getSession();
this.setActiveUser(session.user.name, 'username');
}
});

}
Expand Down