You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Verifies the solvedChallenge (created by `MFA.solveChallenge` on client). Throws an error on failiure, returns the userId that generated the challenge on success.
386
384
387
-
#### MFA.verifyChallenge(type, solvedChallenge)
388
-
Verifies the solvedChallenge (created by `MFA.solveChallenge` on client).
385
+
The userId argument is used to verify that the user that you generated the challenge for is the same as the user you are verifying the challenge for, so you should typically pass in this.userId, or however you can get the current user id. In situations where you are performing this kind of verification in another way, set userId to null.
389
386
390
387
#### MFA.enableDebug()
391
388
Enables debugging
392
389
390
+
#### MFA.generateConnectionHash(connection)
391
+
Creates a connection hash per the config.
392
+
393
+
#### connectionHash
394
+
The connection hash ensures that the same device that creates the challenge is the one that verifies/uses it. When using `MFA.generateChallenge` or `MFA.verifyChallenge`, you can use the `MFA.generateConnectionHash` method to create one, or if you do not need it you can pass an empty string.
395
+
393
396
### Config Options
394
397
395
398
**mfaDetailsField *String* (default: "mfa")** The field where the mfa status object is stored (this is the field you can publish to tell whether a user has enabled)
thrownewError("MFA.generateChallenge: Missing connectionHash. If you don't want to use a hash, pass an empty string when generating and validating a chalenge.");
0 commit comments