Hello Team, I hope you are doing well. We are usin...
# talk-hydra
e
Hello Team, I hope you are doing well. We are using Ory for authentication and authorization to our web site ( using vue.js) Authentication and authorization are working well but still have an open question to make sure that we are implementing good practices for using Ory Services. Below is the code your are using to check k cookie validity and this call is invoking Ory API Whoiam. Do you think that this call should happen to Ory for each requested page? Is there any impact on performance ?
ory
.toSession()
.then(async ({ data }) => {
console.log("data: " + JSON.stringify(data));
})
.catch((err) => {
// Check the error to see if it's a 401 / 403 -> not logged in
errCode = err.response.status;
console.log(errCode);
navigateTo("<http://localhost:4000/ui/login>", { external: true });
});
Thank you.
r
Generally That’s fine. Just keep an eye on rate limits. https://www.ory.sh/docs/guides/rate-limits
Also, you can skip the whoami call alltogether if you have no cookie.
e
Thank you for sharing, it's very helpful to know about those rate limits.