login($username, $password); if (!$token) { throw new PlatformAuthException(PlatformEnum::LEMMY, 'Login failed'); } // Cache for 50 minutes (3000 seconds) to allow buffer before token expires Cache::put('lemmy_jwt_token', $token, config('lemmy.token_ttl', 3000)); return $token; } }