Browse Source

Merge branch 'refs/heads/dev' into R1

peterguo 2 months ago
parent
commit
51b4d4323d
2 changed files with 8 additions and 0 deletions
  1. 1 0
      app/Http/Controllers/API/AuthController.php
  2. 7 0
      app/Services/User/UserService.php

+ 1 - 0
app/Http/Controllers/API/AuthController.php

@@ -9,6 +9,7 @@ use App\Http\Requests\API\User\ResetPasswordRequest;
 use App\Mail\ForgetPasswordMailable;
 use App\Models\GlobalUser;
 use App\Models\User;
+use App\Services\User\UserService;
 use Carbon\Carbon;
 use Illuminate\Http\Request;
 use Illuminate\Support\Facades\Auth;

+ 7 - 0
app/Services/User/UserService.php

@@ -54,4 +54,11 @@ class UserService
             'userIds' => $whitelist,
         ];
     }
+
+    public static function clearCache(): void
+    {
+        $user = Auth::user();
+        $cacheKey = '4s_token_' . $user->username;
+        cache()->forget($cacheKey);
+    }
 }