Skip to content

Instantly share code, notes, and snippets.

@cheoalfredo
Created January 14, 2022 03:23
Show Gist options
  • Save cheoalfredo/7541c47bdc6559b2cfd91eaf5602fac1 to your computer and use it in GitHub Desktop.
Save cheoalfredo/7541c47bdc6559b2cfd91eaf5602fac1 to your computer and use it in GitHub Desktop.
Login, Logout and consume jwt protected http endpoint
public login() {
this.oauthSvc.initLoginFlow()
}
public logoff() {
this.oauthSvc.logOut();
}
hitBackend(): void {
this.client.get("http://localhost:5000/api/numero").subscribe({
next: (data) => { alert(data) },
error: () => {alert("did not work")}
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment