Update user create error message for console to be console specific
This commit is contained in:
parent
32523cf842
commit
404de48cc3
3 changed files with 9 additions and 0 deletions
|
@ -136,6 +136,11 @@ return [
|
||||||
'description' => 'The current project has exceeded the maximum number of users. Please check your user limit in the Appwrite console.',
|
'description' => 'The current project has exceeded the maximum number of users. Please check your user limit in the Appwrite console.',
|
||||||
'code' => 501,
|
'code' => 501,
|
||||||
],
|
],
|
||||||
|
Exception::USER_CONSOLE_COUNT_EXCEEDED => [
|
||||||
|
'name' => Exception::USER_CONSOLE_COUNT_EXCEEDED,
|
||||||
|
'description' => 'Sign up to the console is restricted. You can update console sign up restrictions by setting _APP_CONSOLE_WHITELIST_ROOT to "disabled" or by updating _APP_CONSOLE_WHITELIST_IPS or _APP_CONSOLE_WHITELIST_EMAILS to whitelist your IP or email.',
|
||||||
|
'code' => 501,
|
||||||
|
],
|
||||||
Exception::USER_JWT_INVALID => [
|
Exception::USER_JWT_INVALID => [
|
||||||
'name' => Exception::USER_JWT_INVALID,
|
'name' => Exception::USER_JWT_INVALID,
|
||||||
'description' => 'The JWT token is invalid. Please check the value of the X-Appwrite-JWT header to ensure the correct token is being used.',
|
'description' => 'The JWT token is invalid. Please check the value of the X-Appwrite-JWT header to ensure the correct token is being used.',
|
||||||
|
|
|
@ -215,6 +215,9 @@ App::post('/v1/account')
|
||||||
$total = $dbForProject->count('users', max: APP_LIMIT_USERS);
|
$total = $dbForProject->count('users', max: APP_LIMIT_USERS);
|
||||||
|
|
||||||
if ($total >= $limit) {
|
if ($total >= $limit) {
|
||||||
|
if ('console' === $project->getId()){
|
||||||
|
throw new Exception(Exception::USER_CONSOLE_COUNT_EXCEEDED);
|
||||||
|
}
|
||||||
throw new Exception(Exception::USER_COUNT_EXCEEDED);
|
throw new Exception(Exception::USER_COUNT_EXCEEDED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,6 +63,7 @@ class Exception extends \Exception
|
||||||
|
|
||||||
/** Users */
|
/** Users */
|
||||||
public const USER_COUNT_EXCEEDED = 'user_count_exceeded';
|
public const USER_COUNT_EXCEEDED = 'user_count_exceeded';
|
||||||
|
public const USER_CONSOLE_COUNT_EXCEEDED = 'user_console_count_exceeded';
|
||||||
public const USER_JWT_INVALID = 'user_jwt_invalid';
|
public const USER_JWT_INVALID = 'user_jwt_invalid';
|
||||||
public const USER_ALREADY_EXISTS = 'user_already_exists';
|
public const USER_ALREADY_EXISTS = 'user_already_exists';
|
||||||
public const USER_BLOCKED = 'user_blocked';
|
public const USER_BLOCKED = 'user_blocked';
|
||||||
|
|
Loading…
Reference in a new issue