Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions frontend/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export class AppComponent {
this.page = this.router.routerState.snapshot.url;

if (this.router.routerState.snapshot.root.queryParams.mode === 'demo') {
console.log('App component, demo mode search params found');
this._auth.loginToDemoAccount().subscribe( () => {
this.angulartics2.eventTrack.next({
action: 'Demo account is logged in',
Expand Down Expand Up @@ -241,6 +242,11 @@ export class AppComponent {
user_id: res.id,
email: res.email
});

//@ts-ignore
if (this.isDemo) window.hj?.('identify', this.currentUser.id, {
'mode': 'demo'
});
this._company.getWhiteLabelProperties(res.company.id).subscribe( whiteLabelSettings => {
this.whiteLabelSettings.logo = whiteLabelSettings.logo;
this.whiteLabelSettingsLoaded = true;
Expand Down
1 change: 1 addition & 0 deletions frontend/src/app/auth.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export class AuthGuard implements CanActivate {
const expirationInterval = differenceInMilliseconds(expirationTime, currantTime);
if (expirationInterval > 0) return true;
} else {
console.log('auth guard, expirationInterval <= 0');
this.router.navigate(['/login']);
}
return false;
Expand Down