Skip to content

Commit

Permalink
fix(login): take into account remember me setting (#644)
Browse files Browse the repository at this point in the history
Fixes: #330
  • Loading branch information
yggg authored and nnixaa committed Aug 16, 2018
1 parent ff8e9b6 commit d35b65b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/framework/auth/components/login/login.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ import { NbAuthResult } from '../../services/auth-result';
</div>
<div class="form-group accept-group col-sm-12">
<nb-checkbox name="rememberMe" [(ngModel)]="user.rememberMe">Remember me</nb-checkbox>
<nb-checkbox name="rememberMe" [(ngModel)]="user.rememberMe" *ngIf="rememberMe">Remember me</nb-checkbox>
<a class="forgot-password" routerLink="../request-password">Forgot Password?</a>
</div>
Expand Down Expand Up @@ -133,6 +133,7 @@ export class NbLoginComponent {
user: any = {};
submitted: boolean = false;
socialLinks: NbAuthSocialLink[] = [];
rememberMe = false;

constructor(protected service: NbAuthService,
@Inject(NB_AUTH_OPTIONS) protected options = {},
Expand All @@ -143,6 +144,7 @@ export class NbLoginComponent {
this.showMessages = this.getConfigValue('forms.login.showMessages');
this.strategy = this.getConfigValue('forms.login.strategy');
this.socialLinks = this.getConfigValue('forms.login.socialLinks');
this.rememberMe = this.getConfigValue('forms.login.rememberMe');
}

login(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { HttpErrorResponse, HttpResponse } from '@angular/common/http';

export interface NbPasswordStrategyModule {
alwaysFail?: boolean;
rememberMe?: boolean;
endpoint?: string;
method?: string;
redirect?: {
Expand Down Expand Up @@ -54,7 +53,6 @@ export class NbPasswordAuthStrategyOptions extends NbAuthStrategyOptions {
};
register?: boolean | NbPasswordStrategyModule = {
alwaysFail: false,
rememberMe: true,
endpoint: 'register',
method: 'post',
requireValidToken: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ import { NbAuthIllegalTokenError } from '../../services/token/token';
* };
* register?: boolean | NbPasswordStrategyModule = {
* alwaysFail: false,
* rememberMe: true,
* endpoint: 'register',
* method: 'post',
* requireValidToken: false,
Expand Down

0 comments on commit d35b65b

Please sign in to comment.