diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php
index bba14863..ce5273ab 100644
--- a/app/Http/Kernel.php
+++ b/app/Http/Kernel.php
@@ -24,6 +24,7 @@ class Kernel extends HttpKernel
\App\Http\Middleware\TrimStrings::class,
// \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
\App\Http\Middleware\BootNexus::class,
+ Locale::class,
];
/**
@@ -40,7 +41,6 @@ class Kernel extends HttpKernel
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
- Locale::class,
],
'api' => [
diff --git a/app/Http/Middleware/Locale.php b/app/Http/Middleware/Locale.php
index 83094d73..294c3851 100644
--- a/app/Http/Middleware/Locale.php
+++ b/app/Http/Middleware/Locale.php
@@ -32,7 +32,7 @@ class Locale
$locale = $user->locale;
do_log("locale from user: {$user->id}, set locale: $locale");
} else {
- $locale = self::getLocaleFromCookie() ?? 'en';
+ $locale = self::getLocaleFromCookie() ?? self::getDefault();
do_log("locale from cookie, set locale: $locale");
}
App::setLocale($locale);
diff --git a/public/signup.php b/public/signup.php
index cdbd35db..05e029f6 100644
--- a/public/signup.php
+++ b/public/signup.php
@@ -17,7 +17,6 @@ if ($langid)
}
}
require_once(get_langfile_path("", false, $CURLANGDIR));
-require_once(get_langfile_path("takesignup.php", false, $CURLANGDIR));
cur_user_check ();
$type = $_GET['type'] ?? '';
$isPreRegisterEmailAndUsername = get_setting("system.is_invite_pre_email_and_username") == "yes";
@@ -94,9 +93,9 @@ if ($isPreRegisterEmailAndUsername && !empty($inv["pre_register_email"])) {
?>
|
|
- |
+ |
|
|
- | |
+ | |
diff --git a/public/usercp.php b/public/usercp.php
index ee126b85..26d29843 100644
--- a/public/usercp.php
+++ b/public/usercp.php
@@ -856,7 +856,7 @@ EOD;
if ($privacyupdated == 1)
$to .= "&privacy=1";
clear_user_cache($CURUSER["id"]);
- \Nexus\Database\NexusDB::cache_get(get_challenge_key($userInfo->username));
+ \Nexus\Database\NexusDB::cache_del(get_challenge_key($userInfo->username));
header("Location: $to");
}
stdhead($lang_usercp['head_control_panel'].$lang_usercp['head_security_settings']);
diff --git a/routes/api.php b/routes/api.php
index 676544d3..804a51ba 100644
--- a/routes/api.php
+++ b/routes/api.php
@@ -15,7 +15,7 @@ use App\Enums\Permission\PermissionEnum;
|
*/
-Route::group(['middleware' => ['auth:sanctum', 'locale']], function () {
+Route::group(['middleware' => ['auth:sanctum']], function () {
Route::group(['middleware' => ['user']], function () {
Route::post('logout', [\App\Http\Controllers\AuthenticateController::class, 'logout']);
diff --git a/routes/third-party.php b/routes/third-party.php
index 0b456fdb..74f1d7f2 100644
--- a/routes/third-party.php
+++ b/routes/third-party.php
@@ -1,7 +1,7 @@
['auth.nexus:passkey', 'locale']], function () {
+Route::group(['middleware' => ['auth.nexus:passkey']], function () {
Route::post("pieces-hash", [\App\Http\Controllers\TorrentController::class, "queryByPiecesHash"])->name("torrent.pieces_hash.query");
});
diff --git a/routes/web.php b/routes/web.php
index 6ec39404..f30a4f3b 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -17,7 +17,7 @@ Route::get('/', function () {
return redirect('index.php');
});
-Route::group(['prefix' => 'web', 'middleware' => ['auth.nexus:nexus-web', 'locale']], function () {
+Route::group(['prefix' => 'web', 'middleware' => ['auth.nexus:nexus-web']], function () {
Route::get('torrent-approval-page', [\App\Http\Controllers\TorrentController::class, 'approvalPage']);
Route::get('torrent-approval-logs', [\App\Http\Controllers\TorrentController::class, 'approvalLogs']);
Route::post('torrent-approval', [\App\Http\Controllers\TorrentController::class, 'approval']);