Fixed cs issues
This commit is contained in:
parent
4c5e3947b0
commit
1941cf93b4
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'AF' => 'Afganistan',
|
||||
'AO' => 'Angola',
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'AF' => 'Африка',
|
||||
'AN' => 'Антарктика',
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'AF' => 'Афганістан',
|
||||
'AO' => 'Ангола',
|
||||
|
|
|
@ -48,9 +48,9 @@ $utopia->post('/v1/auth/register')
|
|||
->action(
|
||||
function ($email, $password, $confirm, $success, $failure, $name) use ($request, $response, $register, $audit, $projectDB, $project, $webhook) {
|
||||
if ('console' === $project->getUid()) {
|
||||
$whitlistEmails = $project->getAttribute('authWhitelistEmails');
|
||||
$whitlistIPs = $project->getAttribute('authWhitelistIPs');
|
||||
$whitlistDomains = $project->getAttribute('authWhitelistDomains');
|
||||
$whitlistEmails = $project->getAttribute('authWhitelistEmails');
|
||||
$whitlistIPs = $project->getAttribute('authWhitelistIPs');
|
||||
$whitlistDomains = $project->getAttribute('authWhitelistDomains');
|
||||
|
||||
if (!empty($whitlistEmails) && !in_array($email, $whitlistEmails)) {
|
||||
throw new Exception('Console registration is restricted to specific emails. Contact your administrator for more information.', 401);
|
||||
|
@ -60,11 +60,11 @@ $utopia->post('/v1/auth/register')
|
|||
throw new Exception('Console registration is restricted to specific IPs. Contact your administrator for more information.', 401);
|
||||
}
|
||||
|
||||
if (!empty($whitlistDomains) && !in_array(substr(strrchr($email, "@"), 1), $whitlistDomains)) {
|
||||
if (!empty($whitlistDomains) && !in_array(substr(strrchr($email, '@'), 1), $whitlistDomains)) {
|
||||
throw new Exception('Console registration is restricted to specific domains. Contact your administrator for more information.', 401);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$profile = $projectDB->getCollection([ // Get user by email address
|
||||
'limit' => 1,
|
||||
'first' => true,
|
||||
|
@ -76,7 +76,7 @@ $utopia->post('/v1/auth/register')
|
|||
|
||||
if (!empty($profile)) {
|
||||
if ($failure) {
|
||||
$response->redirect($failure . '?message=User already registered');
|
||||
$response->redirect($failure.'?message=User already registered');
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -777,7 +777,7 @@ $utopia->get('/v1/auth/oauth/:provider/redirect')
|
|||
}
|
||||
|
||||
$oauthID = $oauth->getUserID($accessToken);
|
||||
|
||||
|
||||
if (empty($oauthID)) {
|
||||
if (!empty($state['failure'])) {
|
||||
$response->redirect($state['failure'], 301, 0);
|
||||
|
@ -787,7 +787,7 @@ $utopia->get('/v1/auth/oauth/:provider/redirect')
|
|||
}
|
||||
|
||||
$current = Auth::tokenVerify($user->getAttribute('tokens', []), Auth::TOKEN_TYPE_LOGIN, Auth::$secret);
|
||||
|
||||
|
||||
if ($current) {
|
||||
$projectDB->deleteDocument($current); //throw new Exception('User already logged in', 401);
|
||||
}
|
||||
|
@ -801,7 +801,6 @@ $utopia->get('/v1/auth/oauth/:provider/redirect')
|
|||
],
|
||||
]) : $user;
|
||||
|
||||
|
||||
if (empty($user)) { // No user logged in or with oauth provider ID, create new one or connect with account with same email
|
||||
$name = $oauth->getUserName($accessToken);
|
||||
$email = $oauth->getUserEmail($accessToken);
|
||||
|
|
12
app/init.php
12
app/init.php
|
@ -127,12 +127,12 @@ $locale = $request->getParam('locale', $request->getHeader('X-Appwrite-Locale',
|
|||
|
||||
Locale::$exceptions = false;
|
||||
|
||||
Locale::setLanguage('en', include __DIR__ . '/config/locale/en.php');
|
||||
Locale::setLanguage('he', include __DIR__ . '/config/locale/he.php');
|
||||
Locale::setLanguage('ua', include __DIR__ . '/config/locale/ua.php');
|
||||
Locale::setLanguage('pt-br', include __DIR__ . '/config/locale/pt-br.php');
|
||||
Locale::setLanguage('es', include __DIR__ . '/config/locale/es.php');
|
||||
Locale::setLanguage('ro', include __DIR__ . '/config/locale/ro.php');
|
||||
Locale::setLanguage('en', include __DIR__.'/config/locale/en.php');
|
||||
Locale::setLanguage('he', include __DIR__.'/config/locale/he.php');
|
||||
Locale::setLanguage('ua', include __DIR__.'/config/locale/ua.php');
|
||||
Locale::setLanguage('pt-br', include __DIR__.'/config/locale/pt-br.php');
|
||||
Locale::setLanguage('es', include __DIR__.'/config/locale/es.php');
|
||||
Locale::setLanguage('ro', include __DIR__.'/config/locale/ro.php');
|
||||
|
||||
if (in_array($locale, APP_LOCALES)) {
|
||||
Locale::setDefault($locale);
|
||||
|
|
Loading…
Reference in a new issue