Skip to content

Commit 6338d5c

Browse files
committed
Remove the token when logging out. Add a banner to the login page. Add a favicon.ico file. Increase the duration of the token expiration to 30 days
1 parent a3a222c commit 6338d5c

File tree

5 files changed

+15
-3
lines changed

5 files changed

+15
-3
lines changed

server/routing/ApiRouting.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import * as expressJwt from 'express-jwt';
1919

2020
export class ApiRouting {
2121

22-
tokenExpirationDays:number = 5;
22+
tokenExpirationDays:number = 30;
2323

2424
uploadFolder:string = '';
2525
router:express.Router;

src/assets/img/favicon.ico

31.3 KB
Binary file not shown.

src/index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
<title><%= APP_TITLE %></title>
77
<meta name="description" content="">
88
<meta name="viewport" content="width=device-width, initial-scale=1">
9+
<link rel="icon" type="image/x-icon" href="/assets/img/favicon.ico">
10+
911
<!-- inject:css -->
1012
<!-- endinject -->
1113
</head>
@@ -30,7 +32,7 @@
3032
});
3133
}
3234
</script>
33-
35+
3436
<script>
3537
// Fixes undefined module function in SystemJS bundle
3638
function module() {}

src/login/components/login.html

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
<div class="container">
2+
<div class="jumbotron">
3+
<h1>Login Sample</h1>
4+
For portions of this sample, I'm asking for a login. Click the registration
5+
button to set that up. Note that this is very easy as I don't even verify the
6+
email address. I just wanted this site to have some resemblance to a normal application's
7+
authentication flow. Though the server stores only an encrypted password, since this
8+
connection is not SSL/secure, it is best practice to not use one of your "regular"
9+
passwords. Also, once you register and login, your credentials are saved for 30 days (as
10+
a JSON Web Token in your browser's local storage).
11+
</div>
212
<h2>Login or <a class="btn btn-info btn-large" href="./#/register">Register</a></h2>
3-
413
<form action="">
514
<div class="form-group">
615
<input style="font-size:20pt; color:blue" id="username" autofocus type="text" placeholder="Username" [(ngModel)]="username" />

src/services/Authentication.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ export class Authentication {
8888

8989
logout() {
9090
this._user = null;
91+
localStorage.removeItem('bearerToken');
9192
}
9293

9394
getLastRoute(): string {

0 commit comments

Comments
 (0)