File tree Expand file tree Collapse file tree 4 files changed +8
-28
lines changed Expand file tree Collapse file tree 4 files changed +8
-28
lines changed Original file line number Diff line number Diff line change @@ -37,14 +37,9 @@ async function handleSignInSubmit(event) {
37
37
return ;
38
38
}
39
39
40
- // todo: switch this to coercebase64
41
- const challenge = makeAssertionOptions . challenge . replace ( / - / g, "+" ) . replace ( / _ / g, "/" ) ;
42
- makeAssertionOptions . challenge = Uint8Array . from ( atob ( challenge ) , c => c . charCodeAt ( 0 ) ) ;
43
-
44
- // fix escaping. Change this to coerce
40
+ makeAssertionOptions . challenge = coerceToArrayBuffer ( makeAssertionOptions . challenge ) ;
45
41
makeAssertionOptions . allowCredentials . forEach ( function ( listItem ) {
46
- var fixedId = listItem . id . replace ( / \_ / g, "/" ) . replace ( / \- / g, "+" ) ;
47
- listItem . id = Uint8Array . from ( atob ( fixedId ) , c => c . charCodeAt ( 0 ) ) ;
42
+ listItem . id = coerceToArrayBuffer ( listItem . id ) ;
48
43
} ) ;
49
44
50
45
console . log ( "Assertion options" , makeAssertionOptions ) ;
Original file line number Diff line number Diff line change @@ -42,14 +42,9 @@ async function handleSignInSubmit(event) {
42
42
return ;
43
43
}
44
44
45
- // todo: switch this to coercebase64
46
- const challenge = makeAssertionOptions . challenge . replace ( / - / g, "+" ) . replace ( / _ / g, "/" ) ;
47
- makeAssertionOptions . challenge = Uint8Array . from ( atob ( challenge ) , c => c . charCodeAt ( 0 ) ) ;
48
-
49
- // fix escaping. Change this to coerce
45
+ makeAssertionOptions . challenge = coerceToArrayBuffer ( makeAssertionOptions . challenge ) ;
50
46
makeAssertionOptions . allowCredentials . forEach ( function ( listItem ) {
51
- var fixedId = listItem . id . replace ( / \_ / g, "/" ) . replace ( / \- / g, "+" ) ;
52
- listItem . id = Uint8Array . from ( atob ( fixedId ) , c => c . charCodeAt ( 0 ) ) ;
47
+ listItem . id = coerceToArrayBuffer ( listItem . id ) ;
53
48
} ) ;
54
49
55
50
console . log ( "Assertion options" , makeAssertionOptions ) ;
Original file line number Diff line number Diff line change @@ -35,14 +35,9 @@ async function handleSignInSubmit(event) {
35
35
return ;
36
36
}
37
37
38
- // todo: switch this to coercebase64
39
- const challenge = makeAssertionOptions . challenge . replace ( / - / g, "+" ) . replace ( / _ / g, "/" ) ;
40
- makeAssertionOptions . challenge = Uint8Array . from ( atob ( challenge ) , c => c . charCodeAt ( 0 ) ) ;
41
-
42
- // fix escaping. Change this to coerce
38
+ makeAssertionOptions . challenge = coerceToArrayBuffer ( makeAssertionOptions . challenge ) ;
43
39
makeAssertionOptions . allowCredentials . forEach ( function ( listItem ) {
44
- var fixedId = listItem . id . replace ( / \_ / g, "/" ) . replace ( / \- / g, "+" ) ;
45
- listItem . id = Uint8Array . from ( atob ( fixedId ) , c => c . charCodeAt ( 0 ) ) ;
40
+ listItem . id = coerceToArrayBuffer ( listItem . id ) ;
46
41
} ) ;
47
42
48
43
console . log ( "Assertion options" , makeAssertionOptions ) ;
Original file line number Diff line number Diff line change @@ -35,14 +35,9 @@ async function handleSignInSubmit(event) {
35
35
return ;
36
36
}
37
37
38
- // todo: switch this to coercebase64
39
- const challenge = makeAssertionOptions . challenge . replace ( / - / g, "+" ) . replace ( / _ / g, "/" ) ;
40
- makeAssertionOptions . challenge = Uint8Array . from ( atob ( challenge ) , c => c . charCodeAt ( 0 ) ) ;
41
-
42
- // fix escaping. Change this to coerce
38
+ makeAssertionOptions . challenge = coerceToArrayBuffer ( makeAssertionOptions . challenge ) ;
43
39
makeAssertionOptions . allowCredentials . forEach ( function ( listItem ) {
44
- var fixedId = listItem . id . replace ( / \_ / g, "/" ) . replace ( / \- / g, "+" ) ;
45
- listItem . id = Uint8Array . from ( atob ( fixedId ) , c => c . charCodeAt ( 0 ) ) ;
40
+ listItem . id = coerceToArrayBuffer ( listItem . id ) ;
46
41
} ) ;
47
42
48
43
console . log ( "Assertion options" , makeAssertionOptions ) ;
You can’t perform that action at this time.
0 commit comments