Browse Source

Fixed a problem where the helpdesk verifications controller wasn't using the tokenData received in the response after sending the token to the user.

jalbr74 6 years ago
parent
commit
2e5852037f

+ 5 - 2
client/src/modules/helpdesk/verifications-dialog.controller.ts

@@ -53,7 +53,7 @@ export default class VerificationsDialogController {
     inputs: { name: string, label: string }[];
     inputs: { name: string, label: string }[];
     isDetailsView: boolean;
     isDetailsView: boolean;
     status: string;
     status: string;
-    tokenData: IVerificationTokenResponse;
+    tokenData: string;
     viewDetailsEnabled: boolean;
     viewDetailsEnabled: boolean;
     verificationMethod: string;
     verificationMethod: string;
     verificationStatus: string;
     verificationStatus: string;
@@ -163,7 +163,9 @@ export default class VerificationsDialogController {
         let data = {};
         let data = {};
         this.objectService.assign(data, this.formData);
         this.objectService.assign(data, this.formData);
         if (this.tokenData) {
         if (this.tokenData) {
-            this.objectService.assign(data, this.tokenData);
+            this.objectService.assign(data, {
+                tokenData: this.tokenData
+            });
         }
         }
         this.helpDeskService.validateVerificationData(this.personUserKey, data, this.verificationMethod)
         this.helpDeskService.validateVerificationData(this.personUserKey, data, this.verificationMethod)
             .then((response) => {
             .then((response) => {
@@ -190,6 +192,7 @@ export default class VerificationsDialogController {
         this.helpDeskService.sendVerificationToken(this.personUserKey, this.tokenDestinationID)
         this.helpDeskService.sendVerificationToken(this.personUserKey, this.tokenDestinationID)
             .then((response) => {
             .then((response) => {
                 this.verificationTokenSent = true;
                 this.verificationTokenSent = true;
+                this.tokenData = (response as any).data.tokenData;
             })
             })
             .catch((reason) => {
             .catch((reason) => {
                 this.verificationTokenSent = false;
                 this.verificationTokenSent = false;

+ 1 - 1
client/src/services/helpdesk.service.ts

@@ -51,7 +51,7 @@ export interface IHelpDeskService {
     sendVerificationToken(userKey: string, choice: string): IPromise<IVerificationTokenResponse>;
     sendVerificationToken(userKey: string, choice: string): IPromise<IVerificationTokenResponse>;
     setPassword(userKey: string, random: boolean, password?: string): IPromise<ISuccessResponse>;
     setPassword(userKey: string, random: boolean, password?: string): IPromise<ISuccessResponse>;
     unlockIntruder(userKey: string): IPromise<ISuccessResponse>;
     unlockIntruder(userKey: string): IPromise<ISuccessResponse>;
-    validateVerificationData(userKey: string, formData: any, tokenData: any): IPromise<IVerificationStatus>;
+    validateVerificationData(userKey: string, formData: any, method: any): IPromise<IVerificationStatus>;
     showStrengthMeter: boolean;
     showStrengthMeter: boolean;
 }
 }