Browse Source

feat: remove tenantId from reset-password request

pull/9576/head
bnymncoskuner 5 years ago
parent
commit
8e88fa69d3
  1. 5
      npm/ng-packs/packages/account/src/lib/components/reset-password/reset-password.component.ts
  2. 1
      npm/ng-packs/packages/account/src/lib/proxy/account/models.ts

5
npm/ng-packs/packages/account/src/lib/components/reset-password/reset-password.component.ts

@ -18,7 +18,6 @@ export class ResetPasswordComponent implements OnInit {
inProgress = false; inProgress = false;
isPasswordReset = false; isPasswordReset = false;
tenantId = '';
mapErrorsFn: Validation.MapErrorsFn = (errors, groupErrors, control) => { mapErrorsFn: Validation.MapErrorsFn = (errors, groupErrors, control) => {
if (PASSWORD_FIELDS.indexOf(String(control.name)) < 0) return errors; if (PASSWORD_FIELDS.indexOf(String(control.name)) < 0) return errors;
@ -35,8 +34,7 @@ export class ResetPasswordComponent implements OnInit {
) {} ) {}
ngOnInit(): void { ngOnInit(): void {
this.route.queryParams.subscribe(({ userId, resetToken, tenantId }) => { this.route.queryParams.subscribe(({ userId, resetToken }) => {
this.tenantId = tenantId;
if (!userId || !resetToken) this.router.navigateByUrl('/account/login'); if (!userId || !resetToken) this.router.navigateByUrl('/account/login');
this.form = this.fb.group( this.form = this.fb.group(
@ -63,7 +61,6 @@ export class ResetPasswordComponent implements OnInit {
userId: this.form.get('userId').value, userId: this.form.get('userId').value,
resetToken: this.form.get('resetToken').value, resetToken: this.form.get('resetToken').value,
password: this.form.get('password').value, password: this.form.get('password').value,
tenantId: this.tenantId || undefined, // if this.tenantId is empty, we should not send it at all
}) })
.pipe(finalize(() => (this.inProgress = false))) .pipe(finalize(() => (this.inProgress = false)))
.subscribe(() => { .subscribe(() => {

1
npm/ng-packs/packages/account/src/lib/proxy/account/models.ts

@ -9,7 +9,6 @@ export interface RegisterDto extends ExtensibleObject {
export interface ResetPasswordDto { export interface ResetPasswordDto {
userId?: string; userId?: string;
tenantId?: string;
resetToken: string; resetToken: string;
password: string; password: string;
} }

Loading…
Cancel
Save