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) {
3737 return ;
3838 }
3939
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 ) ;
4541 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 ) ;
4843 } ) ;
4944
5045 console . log ( "Assertion options" , makeAssertionOptions ) ;
Original file line number Diff line number Diff line change @@ -42,14 +42,9 @@ async function handleSignInSubmit(event) {
4242 return ;
4343 }
4444
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 ) ;
5046 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 ) ;
5348 } ) ;
5449
5550 console . log ( "Assertion options" , makeAssertionOptions ) ;
Original file line number Diff line number Diff line change @@ -35,14 +35,9 @@ async function handleSignInSubmit(event) {
3535 return ;
3636 }
3737
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 ) ;
4339 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 ) ;
4641 } ) ;
4742
4843 console . log ( "Assertion options" , makeAssertionOptions ) ;
Original file line number Diff line number Diff line change @@ -35,14 +35,9 @@ async function handleSignInSubmit(event) {
3535 return ;
3636 }
3737
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 ) ;
4339 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 ) ;
4641 } ) ;
4742
4843 console . log ( "Assertion options" , makeAssertionOptions ) ;
You can’t perform that action at this time.
0 commit comments