ui: mfa: use proper request id generation (#17835)

* ui: mfa: use proper request id generation

Fixes: 712cc9ee, ca14c191

Signed-off-by: Konstantin Demin <rockdrilla@gmail.com>

Signed-off-by: Konstantin Demin <rockdrilla@gmail.com>
This commit is contained in:
Konstantin Demin 2022-11-29 19:21:09 +03:00 committed by GitHub
parent 848d20d1c4
commit 5330d34cea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 5 deletions

3
changelog/17835.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:improvement
ui: mfa: use proper request id generation
```

View File

@ -93,11 +93,7 @@ export default function (server) {
} else if (user === 'mfa-j') {
[mfa_constraints, methods] = generator([m('pingid')]); // use to test push failures
}
const numbers = (length) =>
Math.random()
.toString()
.substring(2, length + 2);
const mfa_request_id = `${numbers(8)}-${numbers(4)}-${numbers(4)}-${numbers(4)}-${numbers(12)}`;
const mfa_request_id = crypto.randomUUID();
const mfa_requirement = {
mfa_request_id,
mfa_constraints,