Implementing a logout component

This commit is contained in:
Zoe Roux 2020-03-11 01:05:07 +01:00
parent 8507a2a3cd
commit 2f6e37823e
6 changed files with 30 additions and 2 deletions

View File

@ -1 +1 @@
<p>account works!</p>
<p>Soon</p>

View File

@ -16,6 +16,7 @@ import {LoginComponent} from "./login/login.component";
import {AccountComponent} from "./account/account.component";
import {AuthenticatedGuard} from "./guards/authenticated-guard.service";
import {UnauthorizedComponent} from "./unauthorized/unauthorized.component";
import {LogoutComponent} from "./logout/logout.component";
const routes: Routes = [
{ path: "browse", component: BrowseComponent, pathMatch: "full", resolve: { shows: LibraryResolverService } },
@ -26,6 +27,7 @@ const routes: Routes = [
{ path: "watch/:item", component: PlayerComponent, resolve: { item: StreamResolverService } },
{ path: "search/:query", component: SearchComponent, resolve: { items: SearchResolverService } },
{ path: "login", component: LoginComponent },
{ path: "logout", component: LogoutComponent },
{ path: "account", component: AccountComponent, canActivate: [AuthenticatedGuard], canLoad: [AuthenticatedGuard] },
{ path: "unauthorized", component: UnauthorizedComponent },
{ path: "**", component: NotFoundComponent }

View File

@ -40,6 +40,7 @@ import {
import { AccountComponent } from './account/account.component';
import {AuthenticatedGuard} from "./guards/authenticated-guard.service";
import { UnauthorizedComponent } from './unauthorized/unauthorized.component';
import { LogoutComponent } from './logout/logout.component';
export function loadConfig(oidcConfigService: OidcConfigService)
{
@ -61,7 +62,8 @@ export function loadConfig(oidcConfigService: OidcConfigService)
LoginComponent,
PasswordValidator,
AccountComponent,
UnauthorizedComponent
UnauthorizedComponent,
LogoutComponent
],
imports: [
BrowserModule,

View File

@ -0,0 +1,9 @@
<br/>
<br/>
<br/>
<br/>
<br/>
<div class="text-center">
<h1>Successfully logged out.</h1>
<p>Go back to the <a href="/" routerLink="/" class="text-white">main page</a></p>
</div>

View File

View File

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-logout',
templateUrl: './logout.component.html',
styleUrls: ['./logout.component.scss']
})
export class LogoutComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}