_paschal
07/16/2022, 6:28 AMrp_st
07/16/2022, 6:29 AM_paschal
07/16/2022, 6:33 AMSuperTokens.init
right?rp_st
07/16/2022, 6:33 AM_paschal
07/16/2022, 6:51 AMuseSessionContext
from the chrome extension, right?rp_st
07/16/2022, 6:51 AM_paschal
07/16/2022, 6:54 AMrp_st
07/16/2022, 6:54 AM_paschal
07/16/2022, 6:56 AMrp_st
07/16/2022, 6:56 AMrp_st
07/16/2022, 6:57 AMrp_st
07/16/2022, 6:57 AMrp_st
07/16/2022, 6:57 AM_paschal
07/16/2022, 7:00 AMrp_st
07/16/2022, 7:00 AM_paschal
07/16/2022, 7:46 AMrp_st
07/16/2022, 8:41 AMrp_st
07/16/2022, 8:42 AM_paschal
07/16/2022, 9:11 AMTypeError: getCurves is not a function
On the server, I would get throw a can't get an undefined error at: var signingKey = key.getPublicKey()
rp_st
07/16/2022, 9:15 AMrp_st
07/16/2022, 9:16 AM_paschal
07/16/2022, 9:24 AMimport { useSessionContext } from 'supertokens-auth-react/recipe/session'
is called from the frontend.
My guess is that it has something to do with the defined jwksUri: appInfo.apiDomain + "/auth/jwt/jwks.json",
_paschal
07/16/2022, 9:57 AMfunction getJWTKey(header, callback) {
console.log({ header })
client.getSigningKey(header.kid, function (err, key) {
if (err) {
console.log(err)
}
console.log({ client, error: err, keyR: key })
var signingKey = key.getPublicKey();
callback(err, "");
});
}
The header would return:
{
header: {
kid: '0cc30e35-b021-42b9-826f-2f45ae7de044',
typ: 'JWT',
alg: 'RS256'
}
}
However, there is an error when client.getSigningKey
is called.
Here is the error:
SyntaxError: Unexpected token < in JSON at position 0
at JSON.parse (<anonymous>)
at IncomingMessage.<anonymous> (/Users/mac/Desktop/programs/guihq/app/with-supertokens-app/node_modules/jwks-rsa/src/wrappers/request.js:39:37)
Any idea how to fix this?
The error with getCurves
disappeared when I deleted node_modules and cleared the browser cache.rp_st
07/16/2022, 10:00 AM