1
0
Fork 0
mirror of synced 2024-06-28 19:20:25 +12:00

fix conflicts

This commit is contained in:
Yatharth Verma 2023-09-22 22:53:41 +05:30
parent ddb73eb4f6
commit f07f246f8d
4 changed files with 20 additions and 1 deletions

View file

@ -239,6 +239,15 @@ return [
'name' => Exception::USER_OAUTH2_PROVIDER_ERROR,
'description' => 'OAuth2 provider returned some error.',
'code' => 424,
Exception::USER_EMAIL_ALREADY_VERIFIED => [
'name' => Exception::USER_EMAIL_ALREADY_VERIFIED,
'description' => 'User email is already verified',
'code' => 400,
],
Exception::USER_PHONE_ALREADY_VERIFIED => [
'name' => Exception::USER_PHONE_ALREADY_VERIFIED,
'description' => 'User phone is already verified',
'code' => 400
],
/** Teams */

@ -1 +1 @@
Subproject commit 9b4bcb8140484669421685b4ba89fa1c4d331360
Subproject commit 88b6d59051992ed86183ee83d77bf678d1cb73bf

View file

@ -2669,6 +2669,10 @@ App::post('/v1/account/verification')
if (empty(App::getEnv('_APP_SMTP_HOST'))) {
throw new Exception(Exception::GENERAL_SMTP_DISABLED, 'SMTP Disabled');
}
if($user->getAttribute('emailVerification') == true){
throw new Exception(Exception::USER_EMAIL_ALREADY_VERIFIED);
}
$roles = Authorization::getRoles();
$isPrivilegedUser = Auth::isPrivilegedUser($roles);
@ -2894,6 +2898,10 @@ App::post('/v1/account/verification/phone')
if (empty($user->getAttribute('phone'))) {
throw new Exception(Exception::USER_PHONE_NOT_FOUND);
}
if($user->getAttribute('phoneVerification') == true){
throw new Exception(Exception::USER_PHONE_ALREADY_VERIFIED);
}
$roles = Authorization::getRoles();
$isPrivilegedUser = Auth::isPrivilegedUser($roles);

View file

@ -84,6 +84,8 @@ class Exception extends \Exception
public const USER_OAUTH2_BAD_REQUEST = 'user_oauth2_bad_request';
public const USER_OAUTH2_UNAUTHORIZED = 'user_oauth2_unauthorized';
public const USER_OAUTH2_PROVIDER_ERROR = 'user_oauth2_provider_error';
public const USER_EMAIL_ALREADY_VERIFIED = 'user_email_alread_verified';
public const USER_PHONE_ALREADY_VERIFIED = 'user_phone_already_verified';
/** Teams */
public const TEAM_NOT_FOUND = 'team_not_found';