diff --git a/src/service.rs b/src/service.rs
index 22f25dd..fdd13e1 100644
--- a/src/service.rs
+++ b/src/service.rs
@@ -52,12 +52,12 @@ struct DomainGetArgs {
#[derive(Deserialize)]
struct DomainInitArgs {
domain: domain::Name,
- passphrase: String,
}
#[derive(Deserialize)]
struct DomainSyncArgs {
domain: domain::Name,
+ passphrase: String,
}
impl<'svc> Service<'svc> {
@@ -195,10 +195,6 @@ impl<'svc> Service<'svc> {
}
fn domain_init(&self, args: DomainInitArgs, domain_config: util::FlatConfig) -> SvcResponse {
- if args.passphrase != self.passphrase.as_str() {
- return self.render_error_page(401, "Incorrect passphrase");
- }
-
#[derive(Serialize)]
struct Response {
domain: domain::Name,
@@ -239,6 +235,10 @@ impl<'svc> Service<'svc> {
args: DomainSyncArgs,
domain_config: util::FlatConfig,
) -> SvcResponse {
+ if args.passphrase != self.passphrase.as_str() {
+ return self.render_error_page(401, "Incorrect passphrase");
+ }
+
let config: domain::config::Config = match domain_config.try_into() {
Ok(Some(config)) => config,
Ok(None) => return self.render_error_page(400, "domain config is required"),
diff --git a/src/service/http_tpl/base.html b/src/service/http_tpl/base.html
index be24126..b55a287 100644
--- a/src/service/http_tpl/base.html
+++ b/src/service/http_tpl/base.html
@@ -17,6 +17,12 @@
+
+
diff --git a/src/service/http_tpl/domain.html b/src/service/http_tpl/domain.html
index 186c3e1..4d78193 100644
--- a/src/service/http_tpl/domain.html
+++ b/src/service/http_tpl/domain.html
@@ -14,11 +14,6 @@ automatically updated too!
-
-