Tag javascript

 Note

Fun JS bug of the day introduced by a linting change, that lost me a good amount of time trying to work out what was going wrong:

-  const tokenSet = await client.oauthCallback(redirect, params, { code_verifier });
+  const tokenSet = await client.oauthCallback(redirect, params, { codeVerifier })

Silently changed the meaning of the code here, and needed to be fixed with:

-  const tokenSet = await client.oauthCallback(redirect, params, { codeVerifier }).catch((err) => {
+  const tokenSet = await client.oauthCallback(redirect, params, { code_verifier: codeVerifier }).catch((err) => {

Funnily enough, I've had this lead to dangerous logging in the past, but didn't spot this at first. That'll teach me!

 Like

Liked a post on Twitter
Post details