mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
fix: add null-coalesce on emailIsCorporate in users.php and Memberships
This commit is contained in:
1 parent
8f8d531ec2
commit
0fa4a23c4a
2 files changed
+3
-3
No files matched your search
@@ -148,7 +148,7 @@ function createUser(Hash $hash, string $userId, ?string $email, ?string $passwor
|
||||
throw new Exception(Exception::USER_EMAIL_FREE);
|
||||
}
|
||||
|
||||
if ((($project->getId() === 'console') || ($plan['supportsCorporateEmailValidation'] ?? false)) && ($project->getAttribute('auths', [])['corporateEmails'] ?? false) && !$emailMetadata['emailIsCorporate']) {
|
||||
if ((($project->getId() === 'console') || ($plan['supportsCorporateEmailValidation'] ?? false)) && ($project->getAttribute('auths', [])['corporateEmails'] ?? false) && !($emailMetadata['emailIsCorporate'] ?? true)) {
|
||||
throw new Exception(Exception::USER_EMAIL_NOT_CORPORATE);
|
||||
}
|
||||
|
||||
@@ -1616,7 +1616,7 @@ Http::patch('/v1/users/:userId/email')
|
||||
throw new Exception(Exception::USER_EMAIL_FREE);
|
||||
}
|
||||
|
||||
if ((($project->getId() === 'console') || ($plan['supportsCorporateEmailValidation'] ?? false)) && ($project->getAttribute('auths', [])['corporateEmails'] ?? false) && !$emailMetadata['emailIsCorporate']) {
|
||||
if ((($project->getId() === 'console') || ($plan['supportsCorporateEmailValidation'] ?? false)) && ($project->getAttribute('auths', [])['corporateEmails'] ?? false) && !($emailMetadata['emailIsCorporate'] ?? true)) {
|
||||
throw new Exception(Exception::USER_EMAIL_NOT_CORPORATE);
|
||||
}
|
||||
|
||||
|
||||
@@ -204,7 +204,7 @@ class Create extends Action
|
||||
throw new Exception(Exception::USER_EMAIL_FREE);
|
||||
}
|
||||
|
||||
if ((($project->getId() === 'console') || ($plan['supportsCorporateEmailValidation'] ?? false)) && ($project->getAttribute('auths', [])['corporateEmails'] ?? false) && !$emailMetadata['emailIsCorporate']) {
|
||||
if ((($project->getId() === 'console') || ($plan['supportsCorporateEmailValidation'] ?? false)) && ($project->getAttribute('auths', [])['corporateEmails'] ?? false) && !($emailMetadata['emailIsCorporate'] ?? true)) {
|
||||
throw new Exception(Exception::USER_EMAIL_NOT_CORPORATE);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user