mirror of
https://github.com/bitinflow/expose.git
synced 2026-03-13 13:35:54 +00:00
wip
This commit is contained in:
@@ -65,13 +65,13 @@ class Client
|
|||||||
});
|
});
|
||||||
|
|
||||||
$connection->on('authenticationFailed', function ($data) use ($deferred) {
|
$connection->on('authenticationFailed', function ($data) use ($deferred) {
|
||||||
$this->logger->error("Authentication failed. Please check your authentication token and try again.");
|
$this->logger->error($data->data->message);
|
||||||
|
|
||||||
$this->exit($deferred);
|
$this->exit($deferred);
|
||||||
});
|
});
|
||||||
|
|
||||||
$connection->on('subdomainTaken', function ($data) use ($deferred) {
|
$connection->on('subdomainTaken', function ($data) use ($deferred) {
|
||||||
$this->logger->error("The chosen subdomain \"{$data->data->subdomain}\" is already taken. Please choose a different subdomain.");
|
$this->logger->error($data->data->message);
|
||||||
|
|
||||||
$this->exit($deferred);
|
$this->exit($deferred);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -95,7 +95,9 @@ class ControlMessageController implements MessageComponentInterface
|
|||||||
}, function () use ($connection) {
|
}, function () use ($connection) {
|
||||||
$connection->send(json_encode([
|
$connection->send(json_encode([
|
||||||
'event' => 'authenticationFailed',
|
'event' => 'authenticationFailed',
|
||||||
'data' => []
|
'data' => [
|
||||||
|
'message' => config('expose.admin.messages.invalid_auth_token')
|
||||||
|
]
|
||||||
]));
|
]));
|
||||||
$connection->close();
|
$connection->close();
|
||||||
});
|
});
|
||||||
@@ -148,10 +150,13 @@ class ControlMessageController implements MessageComponentInterface
|
|||||||
if (!is_null($subdomain)) {
|
if (!is_null($subdomain)) {
|
||||||
$controlConnection = $this->connectionManager->findControlConnectionForSubdomain($subdomain);
|
$controlConnection = $this->connectionManager->findControlConnectionForSubdomain($subdomain);
|
||||||
if (!is_null($controlConnection) || $subdomain === config('expose.admin.subdomain')) {
|
if (!is_null($controlConnection) || $subdomain === config('expose.admin.subdomain')) {
|
||||||
|
$message = config('expose.admin.messages.subdomain_taken');
|
||||||
|
$message = str_replace(':subdomain', $subdomain, $message);
|
||||||
|
|
||||||
$connection->send(json_encode([
|
$connection->send(json_encode([
|
||||||
'event' => 'subdomainTaken',
|
'event' => 'subdomainTaken',
|
||||||
'data' => [
|
'data' => [
|
||||||
'subdomain' => $subdomain,
|
'message' => $message,
|
||||||
]
|
]
|
||||||
]));
|
]));
|
||||||
$connection->close();
|
$connection->close();
|
||||||
|
|||||||
@@ -9,8 +9,7 @@ return [
|
|||||||
|
|
||||||
'database' => base_path('database/expose.db'),
|
'database' => base_path('database/expose.db'),
|
||||||
|
|
||||||
'validate_auth_tokens' => false,
|
'validate_auth_tokens' => true,
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
@@ -74,5 +73,11 @@ return [
|
|||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
'user_repository' => \App\Server\UserRepository\DatabaseUserRepository::class,
|
'user_repository' => \App\Server\UserRepository\DatabaseUserRepository::class,
|
||||||
|
|
||||||
|
'messages' => [
|
||||||
|
'invalid_auth_token' => 'Authentication failed. Please check your authentication token and try again.',
|
||||||
|
|
||||||
|
'subdomain_taken' => 'The chosen subdomain :subdomain is already taken. Please choose a different subdomain.',
|
||||||
|
]
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user