-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow only portal link load in iframe (#2153)
* allow only portal link load in iframe * Update web/ui/dashboard/src/app/guards/iframe/iframe.guard.ts Co-authored-by: Raymond Tukpe <[email protected]> * chore: remove redundant return --------- Co-authored-by: Raymond Tukpe <[email protected]> Co-authored-by: Raymond Tukpe <[email protected]>
- Loading branch information
1 parent
578d403
commit 2c59457
Showing
3 changed files
with
32 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
web/ui/dashboard/src/app/guards/iframe/iframe.guard.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { TestBed } from '@angular/core/testing'; | ||
|
||
import { IframeGuard } from './iframe.guard'; | ||
|
||
describe('IframeGuard', () => { | ||
let guard: IframeGuard; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({}); | ||
guard = TestBed.inject(IframeGuard); | ||
}); | ||
|
||
it('should be created', () => { | ||
expect(guard).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { CanActivate } from '@angular/router'; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
export class IframeGuard implements CanActivate { | ||
canActivate(): boolean { | ||
return window.self === window.top; | ||
} | ||
} |