I have a super admin who creates users. Super admin has an option to view as particular user (Just like facebook view as button) where he can access all the pages that the particular user can access.
Coming to implementation in angular, we are using JWT token stored in localstorage which should be included in headers for every API calls from client browser to server.
we want to open a private window in chrome browser for which we will store a separate token to access all the user related pages like a pop-up window or a incognito window in which we will open the url but with a different token.
can anyone please suggest any function where in some websites a child window opens and parent window cant be accessed till we close the child window.
public loginAsTenantAdmin(tenant) {
this.tenantService.loginAsTenantAdmin(tenant.id).subscribe((response: any) => {
var hello = window.open('http://localhost:4200')
hello.sessionStorage.setItem('shadowUser', response.data.jwt);
});
}
<a (click)="loginAsTenantAdmin(tenant)" class="btn m-btn--pill btn-sm">
<i class="fa fa-user-lock" ngbTooltip="Login as Admin" style="color: teal">
</i>
</a>