Catch account already activated error and redirect

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-03-11 14:25:05 +04:00
parent 961980f852
commit af17afeffb
3 changed files with 26 additions and 8 deletions

View File

@@ -42,11 +42,13 @@ export default function ActivateAccountPage() {
onCompleted: (response: ActivateAccountPageMutation$data, errors: GraphQLError[] | null) => {
if (errors) {
for (const err of errors) {
if (err.extensions?.code === "ALREADY_AUTHENTICATED") {
window.location.href = "/";
if (err.extensions?.code === "ACCOUNT_ALREADY_ACTIVATED") {
void navigate({
pathname: safeContinueUrl.pathname,
search: safeContinueUrl.search,
}, { replace: true });
return;
}
// FIXME: If already activated redirect too
}
toast({
title: __("Activation failed"),