Logout from Sitecore
Current version: 9.0
Abstract
How to log users out from Sitecore in your application
You use the logout service in your Angular application to log out from Sitecore. You use it as in this example:
Import the logout module in app.module.ts
:
RequestResponseshell
import { SciLogoutModule } from '@speak/ng-sc/logout';
// ...
imports: [
SciLogoutModule
],
// ...
Inject and use the logout service in a component like this:
RequestResponseshell
import { SciLogoutService } from '@speak/ng-sc/logout';
@Component({
selector: 'app-logout-example',
template: `
<button (click)="logout()">Logout</button>
`
})
export class LogoutExampleComponent {
constructor(
private logoutService: SciLogoutService
) { }
logout(): void {
this.logoutService.logout();
}
}