session-sync-auth-site 0.5.5 → 0.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -244,7 +244,7 @@ const setUpSessionSyncAuthRoutes = ({
|
|
|
244
244
|
if(!id) throw "Invalid payload. Item in `payload.usersToDelete` missing `id` key."
|
|
245
245
|
if(!email) throw "Invalid payload. Item in `payload.usersToDelete` missing `email` key."
|
|
246
246
|
|
|
247
|
-
const [
|
|
247
|
+
const [ userRow ] = await global.sessionSyncAuthSiteConnection.asyncQuery(
|
|
248
248
|
`
|
|
249
249
|
SELECT email
|
|
250
250
|
FROM \`${userTableName}\`
|
|
@@ -255,8 +255,8 @@ const setUpSessionSyncAuthRoutes = ({
|
|
|
255
255
|
},
|
|
256
256
|
)
|
|
257
257
|
|
|
258
|
-
if(!
|
|
259
|
-
if(
|
|
258
|
+
if(!userRow) return // gracefully handle non-existent user
|
|
259
|
+
if(userRow.email !== email) throw "The `id` and `email` passed in do not coorespond."
|
|
260
260
|
|
|
261
261
|
if(mergeToUserId && mergeUser) {
|
|
262
262
|
await mergeUser({
|