Next.js Discord

Discord Forum

How can I use next-auth sign out when 401 is received?

Unanswered
Sun bear posted this in #help-forum
Open in Discord
Sun bearOP
I was using '@react-keycloak/ssr' but I had to update it to next-auth. So I'm wondering how can I do something similar to this with next-auth?
if (!response.ok) {
// 401 : UNAUTHORIZED
if (response.status === 401) {
//await getKeycloakInstance().logout() // TODO: next-auth

0 Replies