Last active
November 4, 2018 01:31
-
-
Save alx-andru/dcc125c466cc66fc5845b33cf6bf971a to your computer and use it in GitHub Desktop.
Minimalistic login redirect with ng-oidc-client
This file contains hidden or 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
| ... | |
| export class AppComponent implements OnInit { | |
| title = 'DraftApp'; | |
| identity$: Observable<User>; | |
| constructor(private oidcFacade: OidcFacade) { | |
| this.identity$ = this.oidcFacade.identity$; | |
| } | |
| ngOnInit() { | |
| this.oidcFacade.getOidcUser(); | |
| } | |
| signinRedirect() { | |
| this.oidcFacade.signinRedirect(); | |
| } | |
| signoutRedirect() { | |
| this.oidcFacade.signoutRedirect(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment