diff --git a/keyserver/src/responders/user-responders.js b/keyserver/src/responders/user-responders.js --- a/keyserver/src/responders/user-responders.js +++ b/keyserver/src/responders/user-responders.js @@ -532,6 +532,7 @@ watchedIDs: t.list(tID), signedIdentityKeysBlob: t.maybe(signedIdentityKeysBlobValidator), initialNotificationsEncryptedMessage: t.maybe(t.String), + doNotRegister: t.maybe(t.Boolean), }); async function siweAuthResponder( @@ -545,6 +546,7 @@ platformDetails, signedIdentityKeysBlob, initialNotificationsEncryptedMessage, + doNotRegister, } = request; const calendarQuery = normalizeCalendarQuery(request.calendarQuery); @@ -633,7 +635,9 @@ // 8. Create account with call to `processSIWEAccountCreation(...)` // if address does not correspond to an existing user. let userID = await fetchUserIDForEthereumAddress(siweMessage.address); - if (!userID) { + if (!userID && doNotRegister) { + throw new ServerError('account_does_not_exist'); + } else if (!userID) { const siweAccountCreationRequest = { address: siweMessage.address, calendarQuery, diff --git a/lib/types/siwe-types.js b/lib/types/siwe-types.js --- a/lib/types/siwe-types.js +++ b/lib/types/siwe-types.js @@ -21,6 +21,7 @@ +watchedIDs: $ReadOnlyArray, +signedIdentityKeysBlob?: ?SignedIdentityKeysBlob, +initialNotificationsEncryptedMessage?: string, + +doNotRegister?: boolean, }; export type SIWEAuthServerCall = {