Merge pull request #1899 from appwrite/redirect-domain

Redirect after domain verified
This commit is contained in:
Darshan
2025-05-26 20:09:30 +05:30
committed by GitHub
2 changed files with 20 additions and 2 deletions
@@ -16,13 +16,18 @@
Input,
InteractiveText
} from '@appwrite.io/pink-svelte';
import { base } from '$app/paths';
import { page } from '$app/state';
import { goto } from '$app/navigation';
export let domain: Domain;
let verified = undefined;
const routeBase = `${base}/organization-${page.params.organization}/domains/domain-${domain.$id}`;
// TODO: split _APP_DOMAINS_NAMESERVERS?
let nameservers = $consoleVariables?._APP_DOMAINS_NAMESERVERS.split(',') ?? [
const nameservers = $consoleVariables?._APP_DOMAINS_NAMESERVERS.split(',') ?? [
'ns1.appwrite.io',
'ns2.appwrite.io'
];
@@ -31,6 +36,19 @@
try {
domain = await sdk.forConsole.domains.updateNameservers(domain.$id);
verified = domain.nameservers === 'Appwrite';
if (verified) {
addNotification({
type: 'success',
message: 'Domain verified'
});
await goto(routeBase);
} else {
addNotification({
type: 'error',
message: 'Domain not verified'
});
}
} catch (error) {
addNotification({
type: 'error',
@@ -13,7 +13,7 @@
export let show = false;
export let selectedDomain: Domain;
let nameservers = $consoleVariables?._APP_DOMAINS_NAMESERVERS.split(',') ?? [
const nameservers = $consoleVariables?._APP_DOMAINS_NAMESERVERS.split(',') ?? [
'ns1.appwrite.io',
'ns2.appwrite.io'
];