Skip to content

Commit

Permalink
Information page change
Browse files Browse the repository at this point in the history
  • Loading branch information
cname87 committed Nov 17, 2019
1 parent 765c69e commit bdab25f
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 55 deletions.
20 changes: 19 additions & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,25 @@
"focus": true,
"panel": "dedicated"
},
"problemMatcher": []
"problemMatcher": [
{
"pattern": [
{
"regexp": ".",
"file": 1,
"location": 2,
"message": 3
}
],
"background": {
"activeOnStart": true,
"beginsPattern": {
"regexp": "(.*?)"
},
"endsPattern": "Connected to"
}
}
]
},
{
"label": "Check Server",
Expand Down
15 changes: 9 additions & 6 deletions frontend/src/app/components/information/information.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,15 @@ export class InformationComponent implements OnInit {

/* set up log in only if a mode query parameter of 'login' is passed in */
} else if (this.mode === 'login') {
this.header = this.auth.isLoggedIn ? 'Log Out' : 'Log In';
this.hint = this.auth.isLoggedIn
? 'Click on the log out button above (or click on a link above)'
: 'Click on the Log In button above';
this.isGoBackVisible = false;

this.auth.isAuthenticated$.subscribe({
next: (loggedIn) => {
this.header = loggedIn ? 'Log Out' : 'Log In';
this.hint = loggedIn
? 'Click on the log out button above (or click on a link above)'
: 'Click on the Log In button above';
this.isGoBackVisible = false;
},
});
/* else set up the page not found */
} else {
this.header = 'Page Not Found';
Expand Down
47 changes: 0 additions & 47 deletions frontend/src/app/router/guards/login.guard.ts

This file was deleted.

2 changes: 1 addition & 1 deletion frontend/src/app/shared/auth.service/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export class AuthService {
);

/**
* Calls the Auth0 client instance to check whether the user has logged in and been authenticated. Sets isLoggedIn to the result.
* Calls the Auth0 client instance to check whether the user has logged in and been authenticated. Emits true if authenticated and false if not and sets isLoggedIn to the result.
* Note: Called by AuthGuard to check status, i.e. when the login expires AuthGuard will direct to the login page.
*/
public isAuthenticated$ = this.auth0Client$.pipe(
Expand Down

0 comments on commit bdab25f

Please sign in to comment.