···2525 newPds: '',
2626 newEmail: '',
2727 newHandle: '',
2828- inviteCode: '',
2828+ inviteCode: null,
2929 twoFactorCode: null,
3030 confirmation: false,
3131 showTwoFactorCodeInput: false,
···178178179179 <div class="form-group">
180180 <label for="invite-code">Invite Code:</label>
181181- <input type="text" id="invite-code" name="invite-code" placeholder="Invite code from your new PDS"
182182- x-model="inviteCode" required>
181181+ <input type="text" id="invite-code" name="invite-code" placeholder="Invite code from your new PDS (Leave blank if you don't have one)"
182182+ x-model="inviteCode">
183183 </div>
184184 </div>
185185 <div class="form-group">
+12-8
src/pdsmoover.js
···5454 * @param {string} newPdsUrl - The new URL for your pds. Like https://coolnewpds.com
5555 * @param {string} newEmail - The email you want to use on the new pds (can be the same as the previous one as long as it's not already being used on the new pds)
5656 * @param {string} newHandle - The new handle you want, like alice.bsky.social, or if you already have a domain name set as a handle can use it myname.com.
5757- * @param {string} inviteCode - The invite code you got from the PDS you are migrating to
5757+ * @param {string|null} inviteCode - The invite code you got from the PDS you are migrating to. If null does not include one
5858 * @param {function|null} statusUpdateHandler - a function that takes a string used to update the UI. Like (status) => console.log(status)
5959 * @param {string|null} twoFactorCode - Optional, but needed if it fails with 2fa required
6060 */
···114114 });
115115 const serviceJwt = createAuthResp.data.token;
116116117117- const createNewAccount = await newAgent.com.atproto.server.createAccount({
117117+ let createAccountRequest = {
118118 did: usersDid,
119119 handle: newHandle,
120120 email: newEmail,
121121 password: password,
122122- inviteCode: inviteCode,
123123- },
124124- {
125125- headers: {authorization: `Bearer ${serviceJwt}`},
126126- encoding: 'application/json',
127127- });
122122+ };
123123+ if (inviteCode) {
124124+ createAccountRequest.inviteCode = inviteCode;
125125+ }
126126+ const createNewAccount = await newAgent.com.atproto.server.createAccount(
127127+ createAccountRequest,
128128+ {
129129+ headers: {authorization: `Bearer ${serviceJwt}`},
130130+ encoding: 'application/json',
131131+ });
128132129133 if (createNewAccount.data.did !== usersDid.toString()) {
130134 throw new Error('Did not create the new account with the same did as the old account');