Skip to content

Commit

Permalink
Closes #31: Remember me now has an expire date of 30 days from last l…
Browse files Browse the repository at this point in the history
…ogin.
  • Loading branch information
shakedown-street committed Nov 2, 2016
1 parent 6712ead commit 5c1705d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions NewFrontend/app/src/app/components/login/login.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class LoginComponent implements OnInit {
router.navigate(['/']);
}

let savedUser = this.cookies.get('saved-user')
let savedUser = this.cookies.get('saved-user');
if (savedUser != null) {
this.username = savedUser;
this.rememberMe = true;
Expand All @@ -38,7 +38,9 @@ export class LoginComponent implements OnInit {

public login() {
if (this.rememberMe) {
this.cookies.put('saved-user', this.username);
let expireDate = new Date();
expireDate.setDate(expireDate.getDate() + 30);
this.cookies.put('saved-user', this.username, {'expires': expireDate});
} else {
this.cookies.put('saved-user', null);
}
Expand Down

0 comments on commit 5c1705d

Please sign in to comment.