Drake
Drake
RRefine
Created by xenial-black on 11/19/2022 in #ask-any-question
Extending AuthPage
Anyone have any suggestions on how to extend the AuthPage's RegisterPage to include additional input fields?
16 replies
RRefine
Created by other-emerald on 11/18/2022 in #ask-any-question
Can't refetch Auth
I'm not sure if this is a refine or react problem, but the Router Provider keeps thinking I'm unauthenticated, but I'm not. Below is my code:
const { isFetching, refetch: checkAuth } = useAuthenticated();

const { mutate } = useUpdate();

useEffect(() => {
if (isFetching) return;

if (teamId && membershipId && secret && userId) {
mutate(
{
dataProviderName: "teams",
resource: teamsResources.membershipStatus,
id: teamId,
values: { membershipId, secret, userId },
},
{
onSuccess: async () => {
try {
await checkAuth();

list(Constants.collections.organizations);
} catch (e) {
console.error(e);
}
},
}
);
}
}, [isFetching, membershipId, secret, teamId, userId]);
const { isFetching, refetch: checkAuth } = useAuthenticated();

const { mutate } = useUpdate();

useEffect(() => {
if (isFetching) return;

if (teamId && membershipId && secret && userId) {
mutate(
{
dataProviderName: "teams",
resource: teamsResources.membershipStatus,
id: teamId,
values: { membershipId, secret, userId },
},
{
onSuccess: async () => {
try {
await checkAuth();

list(Constants.collections.organizations);
} catch (e) {
console.error(e);
}
},
}
);
}
}, [isFetching, membershipId, secret, teamId, userId]);
Any ideas?
17 replies