Hey guys, is there a guide from migrating from the...
# prisma-whats-new
f
Hey guys, is there a guide from migrating from the old Console Auth0 Integration to a new resolver ?
j
Hey @fred, I was able to get something working via https://github.com/fdidron/templates/tree/master/auth/auth0 and swapping out the verify token from using the RSA stuff to just shared secret verification.
Copy code
const verifyToken = token => {
  const decoded = jwt.verify(token, process.env.AUTH0_SECRET);
  if(!decoded){
    throw new Error('Failed to authorize token or it was invalid')
  } else {
    return decoded;
  }
}
You'll also want to fixup the env checker in the default export handler to look for AUTH0_SECRET instead of the other stuff.
Now. You will NOT be able to just keeping passing in the auth0 token directly in the header, you'll have to trade out the auth0 jwt for a graphcool one
At least as far as I can tell
f
Thanks so much @jshort! I'll have a look at this.
j
👍
n
@jshort am I right in assuming that by using the shared secret you are still using HS256?
j
Correct
To much inertia on that right now to switch
n
yep definitely, thanks of clarifying 👍