Skip to content

Commit

Permalink
fix: make sure DNS verification jobs are cancelled when use claims a …
Browse files Browse the repository at this point in the history
…new username.
  • Loading branch information
zicklag committed Dec 19, 2024
1 parent 7ca82e1 commit fde302e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/lib/dns/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ export async function startDnsServer() {
// Don't go to next so that our normal default NS response doesn't get created.
// We're trying to emulate the way that authoritative nameservers won't respond
// to NS queries on subdomains that don't have custom nameservers.
return next();;
return next();
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib/server-globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ import type { DefaultServer } from 'dinodns/common/server';
* don't change _this_ file, which is not a problem because it exists only for exporting this
* variable that never needs to change during development.
* */
export const serverGlobals: { dnsServer?: DefaultServer; cronJobs?: CronJob[] } = { };
export const serverGlobals: { dnsServer?: DefaultServer; cronJobs?: CronJob[] } = {};
5 changes: 4 additions & 1 deletion src/lib/usernames/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ with value "${expectedValue}". Found other values: ${txtRecords.map((v) => `"${v
await unset(oldUsername);
}

// Be sure to kill any in-progress DNS verification jobs for this user.
await removeDomainVerificationJob(rauthyId);

return;
} catch (e) {
failures += 1;
Expand Down Expand Up @@ -379,5 +382,5 @@ export const usernames = {
cronJob,
setDomainVerificationJob,
getDomainVerificationJob,
removeDomainVerificationJob,
removeDomainVerificationJob
};

0 comments on commit fde302e

Please sign in to comment.