mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
Merge pull request #1899 from appwrite/redirect-domain
Redirect after domain verified
This commit is contained in:
@@ -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'
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user