Merge pull request #672 from shocknet/check-app-id

check app id
This commit is contained in:
Justin (shocknet) 2024-04-09 19:58:10 -04:00 committed by GitHub
commit d0b7a8fd99

View file

@ -96,6 +96,9 @@ export default class {
} }
const user = await entityManager.getRepository(ApplicationUser).findOne({ where: { nostr_public_key: nostrPub } }) const user = await entityManager.getRepository(ApplicationUser).findOne({ where: { nostr_public_key: nostrPub } })
if (user) { if (user) {
if (user.application.app_id !== application.app_id) {
throw new Error("tried to access a user of application:" + user.application.app_id + "from application:" + application.app_id)
}
return user return user
} }
if (!application.allow_user_creation) { if (!application.allow_user_creation) {