Curzon
Curzon
Explore posts from servers
RRefine
Created by correct-apricot on 11/19/2023 in #ask-any-question
Refine OAuth doesn't work to send user to "admin" page after login
@kapa.ai
check: async (ctx) => {
const { token } = nookies.get(ctx);
const { data } = await supabaseClient.auth.getUser(token);
const { user } = data;

if (user) {
return {
authenticated: true,
};
}

return {
authenticated: false,
redirectTo: "/login",
};
},
check: async (ctx) => {
const { token } = nookies.get(ctx);
const { data } = await supabaseClient.auth.getUser(token);
const { user } = data;

if (user) {
return {
authenticated: true,
};
}

return {
authenticated: false,
redirectTo: "/login",
};
},
This is what I did to check for auth using the Authprovider
8 replies