mirror of
https://github.com/lkddi/Xboard.git
synced 2026-04-16 05:00:54 +08:00
eat: add reCAPTCHA v3 and Cloudflare Turnstile verification support
- Implement reCAPTCHA v3 with score-based validation - Add Cloudflare Turnstile as captcha alternative - Create reusable CaptchaService for unified validation - Support switching between recaptcha, recaptcha-v3, and turnstile - Maintain backward compatibility with existing configurations
This commit is contained in:
@@ -10,6 +10,7 @@ use App\Models\Order;
|
||||
use App\Models\Plan;
|
||||
use App\Models\Ticket;
|
||||
use App\Models\User;
|
||||
use App\Services\Auth\LoginService;
|
||||
use App\Services\AuthService;
|
||||
use App\Services\UserService;
|
||||
use App\Utils\CacheKey;
|
||||
@@ -19,6 +20,14 @@ use Illuminate\Support\Facades\Cache;
|
||||
|
||||
class UserController extends Controller
|
||||
{
|
||||
protected $loginService;
|
||||
|
||||
public function __construct(
|
||||
LoginService $loginService
|
||||
) {
|
||||
$this->loginService = $loginService;
|
||||
}
|
||||
|
||||
public function getActiveSession(Request $request)
|
||||
{
|
||||
$user = User::find($request->user()->id);
|
||||
@@ -205,15 +214,7 @@ class UserController extends Controller
|
||||
return $this->fail([400, __('The user does not exist')]);
|
||||
}
|
||||
|
||||
$code = Helper::guid();
|
||||
$key = CacheKey::get('TEMP_TOKEN', $code);
|
||||
Cache::put($key, $user->id, 60);
|
||||
$redirect = '/#/login?verify=' . $code . '&redirect=' . ($request->input('redirect') ? $request->input('redirect') : 'dashboard');
|
||||
if (admin_setting('app_url')) {
|
||||
$url = admin_setting('app_url') . $redirect;
|
||||
} else {
|
||||
$url = url($redirect);
|
||||
}
|
||||
$url = $this->loginService->generateQuickLoginUrl($user, $request->input('redirect'));
|
||||
return $this->success($url);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user