[PM-6125] Handle kp.alg is string (#10285)
* fix: handle cases when `kp.alg` is `string` in `createCredential` for `Fido2` * feat: simplify and move fix to mappers * fix null filter --------- Co-authored-by: Alessio Cosenza <cosenzaalessio17@gmail.com> Co-authored-by: Merissa Weinstein <merissa.k.weinstein@gmail.com> Co-authored-by: Todd Martin <tmartin@bitwarden.com>
This commit is contained in:
parent
3e37daf236
commit
71413a7b3b
|
@ -36,10 +36,13 @@ export class WebauthnUtils {
|
|||
extensions: {
|
||||
credProps: keyOptions.extensions?.credProps,
|
||||
},
|
||||
pubKeyCredParams: keyOptions.pubKeyCredParams.map((params) => ({
|
||||
alg: params.alg,
|
||||
type: params.type,
|
||||
})),
|
||||
pubKeyCredParams: keyOptions.pubKeyCredParams
|
||||
.map((params) => ({
|
||||
// Fix for spec-deviation: Sites using KeycloakJS send `kp.alg` as a string
|
||||
alg: Number(params.alg),
|
||||
type: params.type,
|
||||
}))
|
||||
.filter((params) => !isNaN(params.alg)),
|
||||
rp: {
|
||||
id: keyOptions.rp.id,
|
||||
name: keyOptions.rp.name,
|
||||
|
|
Loading…
Reference in New Issue