Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#19] Login redirect state url fixed #21

Merged
merged 4 commits into from
Sep 14, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Set returnUrl to queryParam value immediately
  • Loading branch information
paulbert committed Sep 12, 2017
commit 47959177c3d256e9526016644b770ab8de56fa11
5 changes: 2 additions & 3 deletions src/app/login/login.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ export class LoginComponent {
) { }

createMode:boolean = this.router.url.split('?')[0] === '/login/newuser';
returnUrl = this.route.snapshot.queryParams['returnUrl'] || '/';
model = { name:'', password:'', repeatPassword:'' }
message = '';
returnUrl: string;

onSubmit() {
if(this.createMode) {
Expand All @@ -55,7 +55,6 @@ export class LoginComponent {
}

reRoute() {
this.returnUrl = this.route.snapshot.queryParams['returnUrl'] || '/';
this.router.navigate([this.returnUrl]);
}

Expand All @@ -78,4 +77,4 @@ export class LoginComponent {
this.reRoute();
},(error) => this.message = 'Username and/or password do not match');
}
}
}