referenceId PR feedback + lint fix

This commit is contained in:
Chad Scharf 2020-06-25 16:30:45 -04:00
parent 869ee217eb
commit 88c8c8ae55
2 changed files with 6 additions and 7 deletions

View File

@ -79,6 +79,11 @@ export class RegisterComponent extends BaseRegisterComponent {
} }
if (qParams.reference != null) { if (qParams.reference != null) {
this.referenceId = qParams.reference; this.referenceId = qParams.reference;
} else {
this.referenceId = ('; ' + document.cookie).split('; reference=').pop().split(';').shift();
}
if (this.referenceId === '') {
this.referenceId = null;
} }
if (queryParamsSub != null) { if (queryParamsSub != null) {
queryParamsSub.unsubscribe(); queryParamsSub.unsubscribe();
@ -99,12 +104,6 @@ export class RegisterComponent extends BaseRegisterComponent {
if (this.policies != null) { if (this.policies != null) {
this.enforcedPolicyOptions = await this.policyService.getMasterPasswordPolicyOptions(this.policies); this.enforcedPolicyOptions = await this.policyService.getMasterPasswordPolicyOptions(this.policies);
} }
const referenceId = ('; ' + document.cookie).split('; reference=').pop().split(';').shift();
this.referenceId = this.referenceId || referenceId;
if (this.referenceId === '') {
this.referenceId = null;
}
} }
async submit() { async submit() {

View File

@ -8,8 +8,8 @@ import { ActivatedRoute } from '@angular/router';
import { BroadcasterService } from 'jslib/angular/services/broadcaster.service'; import { BroadcasterService } from 'jslib/angular/services/broadcaster.service';
import { UserService } from 'jslib/abstractions/user.service';
import { EnvironmentService } from 'jslib/abstractions/environment.service'; import { EnvironmentService } from 'jslib/abstractions/environment.service';
import { UserService } from 'jslib/abstractions/user.service';
import { Organization } from 'jslib/models/domain/organization'; import { Organization } from 'jslib/models/domain/organization';