Hello,
I’m struggling a bit to validate the user status, I’m using the nextjs sdk, I’m able to login/logout/etc, everything work fine but there is a small issue, once I’m logged, if I delete the user in auth0 it is still logged in my app because it has a valid cookie, to avoid this issue I’m validating the user on every SSR request and if the user is blocked/deleted I redirect him to the logout endpoint.
This is the code I’m using:
await axios.get(`http://${req.headers.host}/api/auth/me`, {
headers: {
cookie: req.headers.cookie
}
});
and this is the callback:
async profile(req, res) {
try {
await handleProfile(req, res, {
refetch: true
});
} catch (error) {
const status = error.message === "invalid_token" ? 401 : error.status;
return res.status(status || 500).end(error.message);
}
},
with this code is working fine but I’m getting this error:
data: 'access_denied (Too Many Requests)'
indeed there is a very small rate limit:
5 requests per minute with bursts up to 10 requests
are there any valid alternative? Im sure there is another way to handle this without exceeding the rate limit
I’m using:
“@auth0/nextjs-auth0”: “^1.3.0”,
“next”: “10.2.0”
many thanks