Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F102796155
auth-guard.service.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Feb 24, 06:48
Size
455 B
Mime Type
text/x-java
Expires
Wed, Feb 26, 06:48 (2 d)
Engine
blob
Format
Raw Data
Handle
24426803
Attached To
R8244 Eawag_Swing_Weight_Elicitation
auth-guard.service.ts
View Options
import { Injectable } from '@angular/core';
import { Router, CanActivate } from '@angular/router';
import { AuthenticationService } from './authentication.service';
@Injectable()
export class AuthGuardService implements CanActivate {
constructor(private auth: AuthenticationService, private router: Router) {}
canActivate() {
if (!this.auth.isLoggedIn()) {
this.router.navigateByUrl('/');
return false;
}
return true;
}
}
Event Timeline
Log In to Comment