Format docs using linter and prettier.
This commit is contained in:
@@ -72,11 +72,6 @@ Dictates access to routes depending on the authentication status.</p>
|
||||
|
||||
|
||||
|
||||
<p class="comment">
|
||||
<h3>Example</h3>
|
||||
</p>
|
||||
<div class="io-description">
|
||||
</div>
|
||||
|
||||
<section>
|
||||
<h3 id="index">Index</h3>
|
||||
@@ -117,7 +112,7 @@ Dictates access to routes depending on the authentication status.</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="17" class="link-to-prism">src/app/_guards/auth.guard.ts:17</a></div>
|
||||
<div class="io-line">Defined in <a href="" data-line="21" class="link-to-prism">src/app/_guards/auth.guard.ts:21</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -191,8 +186,8 @@ Dictates access to routes depending on the authentication status.</p>
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="35"
|
||||
class="link-to-prism">src/app/_guards/auth.guard.ts:35</a></div>
|
||||
<div class="io-line">Defined in <a href="" data-line="38"
|
||||
class="link-to-prism">src/app/_guards/auth.guard.ts:38</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -275,7 +270,13 @@ ActivatedRouteSnapshot can also be used to traverse the router state tree.</li>
|
||||
|
||||
<div class="tab-pane fade tab-source-code" id="c-source">
|
||||
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { Injectable } from '@angular/core';
|
||||
import {ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot, UrlTree} from '@angular/router';
|
||||
import {
|
||||
ActivatedRouteSnapshot,
|
||||
CanActivate,
|
||||
Router,
|
||||
RouterStateSnapshot,
|
||||
UrlTree,
|
||||
} from '@angular/router';
|
||||
|
||||
// Third party imports
|
||||
import { Observable } from 'rxjs';
|
||||
@@ -283,14 +284,11 @@ import { Observable } from 'rxjs';
|
||||
/**
|
||||
* Auth guard implementation.
|
||||
* Dictates access to routes depending on the authentication status.
|
||||
*
|
||||
* @implements CanActivate
|
||||
*/
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class AuthGuard implements CanActivate {
|
||||
|
||||
/**
|
||||
* Instantiates the auth guard class.
|
||||
*
|
||||
@@ -309,14 +307,14 @@ export class AuthGuard implements CanActivate {
|
||||
*/
|
||||
canActivate(
|
||||
route: ActivatedRouteSnapshot,
|
||||
state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
|
||||
state: RouterStateSnapshot
|
||||
): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
|
||||
if (localStorage.getItem(btoa('CICADA_PRIVATE_KEY'))) {
|
||||
return true;
|
||||
}
|
||||
this.router.navigate(['/auth']);
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
</code></pre>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user