davido_k
03/18/2023, 2:30 PMAuth state verification failed. The auth provider responded with an invalid state
In my /api/auth/...path.js file the body comes in as empty. Is there any middle ware firing before this that I should look at?
export default async function superTokens(req, res) {
console.log("API req.query: ", req.query)
console.log("API req.url: ", req.url)
console.log("API req.body: ", req.body)
// NOTE: We need CORS only if we are querying the APIs from a different origin
await NextCors(req, res, {
methods: ["GET", "HEAD", "PUT", "PATCH", "POST", "DELETE"],
origin: websiteDomain,
credentials: true,
allowedHeaders: ["content-type", ...supertokens.getAllCORSHeaders()]
})
await superTokensNextWrapper(
async (next) => {
// This is needed for production deployments with Vercel
res.setHeader("Cache-Control", "no-cache, no-store, max-age=0, must-revalidate")
await middleware()(req, res, next)
},
req,
res
)
if (!res.writableEnded) {
res.status(404).send("Not found")
}
}
rp_st
03/19/2023, 5:33 AMrp_st
03/19/2023, 5:33 AMdavido_k
03/19/2023, 1:20 PMrp_st
03/19/2023, 1:45 PMnkshah2
03/20/2023, 7:27 AMnkshah2
03/20/2023, 7:40 AMstate
etc in the URL as query params). But with native flows such as popup you will need to call the SuperTokens APIs manuallynkshah2
03/20/2023, 7:41 AMdavido_k
03/20/2023, 2:37 PMrp_st
03/20/2023, 3:28 PMrp_st
03/20/2023, 3:28 PMdavido_k
03/20/2023, 5:14 PMdavido_k
03/20/2023, 5:14 PMdavido_k
03/20/2023, 5:15 PMrp_st
03/20/2023, 5:35 PMsattvikc
03/21/2023, 7:12 AMdavido_k
03/24/2023, 3:21 AMdavido_k
03/29/2023, 11:05 PMexport function AppleWithTrailingSlash(config) {
const appleProvider = ThirdPartyEmailPassword.Apple(config)
return {
...appleProvider,
get: function (redirectURI, authCodeResponse, userContext) {
const getResponse = appleProvider.get(redirectURI, authCodeResponse, userContext)
return {
...getResponse,
getRedirectURI: function () {
return appInfo.apiDomain.getAsStringDangerous() + appInfo.apiBasePath.getAsStringDangerous() + "/callback/apple/"
}
}
}
}
}