Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Jan Smejkal
Pa165 Secret Archive
Commits
1b30e88d
Commit
1b30e88d
authored
May 21, 2022
by
Tomáš Biloš
Browse files
add auth guard
parent
9b8c939b
Pipeline
#141964
waiting for manual action with stage
Changes
4
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
frontend/src/app/app-routing.module.ts
View file @
1b30e88d
...
...
@@ -5,6 +5,7 @@ import { AgentListComponent } from './agent/agent-list.component';
import
{
AssignmentCreateComponent
}
from
'
./assignment/assignment-create.component
'
;
import
{
AssignmentDetailComponent
}
from
'
./assignment/assignment-detail.component
'
;
import
{
AuthComponent
}
from
'
./auth/auth.component
'
;
import
{
AuthGuard
}
from
'
./auth/auth.guard
'
;
import
{
CountryDetailComponent
}
from
'
./country/country-detail.component
'
;
import
{
CountryListComponent
}
from
'
./country/country-list.component
'
;
import
{
HomeComponent
}
from
'
./home/home.component
'
;
...
...
@@ -17,6 +18,7 @@ const routes: Routes = [
{
path
:
'
auth
'
,
component
:
AuthComponent
,
canActivate
:
[
AuthGuard
],
children
:
[
{
path
:
''
,
component
:
HomeComponent
,
pathMatch
:
'
full
'
},
{
path
:
'
agent/:id
'
,
component
:
AgentDetailComponent
},
...
...
frontend/src/app/auth/auth.component.html
View file @
1b30e88d
...
...
@@ -3,7 +3,7 @@
<mat-icon>
home
</mat-icon>
</button>
<div>
Secret archive
</div>
<button
mat-icon-button
routerLink=
"/"
>
<button
mat-icon-button
routerLink=
"/"
(click)=
"logOut()"
>
<mat-icon>
logout
</mat-icon>
</button>
</div>
...
...
frontend/src/app/auth/auth.component.ts
View file @
1b30e88d
import
{
Component
}
from
'
@angular/core
'
;
import
{
AuthService
}
from
'
./auth.service
'
;
@
Component
({
selector
:
'
auth
'
,
templateUrl
:
'
./auth.component.html
'
})
export
class
AuthComponent
{}
export
class
AuthComponent
{
constructor
(
private
authService
:
AuthService
)
{}
logOut
()
{
this
.
authService
.
logout
();
}
}
frontend/src/app/mission/mission-list.component.ts
View file @
1b30e88d
...
...
@@ -6,7 +6,6 @@ import { environment } from '../../environments/environment';
import
{
RequestState
}
from
'
../request-state.enum
'
;
import
{
Mission
}
from
'
./mission.interface
'
;
interface
MissionTableItem
{
id
:
string
;
name
:
string
;
...
...
@@ -40,8 +39,4 @@ export class MissionListComponent implements OnInit {
throw
err
;
}
}
goToMissionDetail
(
missionId
:
string
)
{
this
.
router
.
navigate
([
'
mission
'
,
missionId
]);
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment