Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/madebyaris/poinf-of-salesWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/madebyaris/poinf-of-sales/authentication-and-security-patterns)<a href="https://agentmods.dev/rules/madebyaris/poinf-of-sales/authentication-and-security-patterns"><img src="https://agentmods.dev/badge/rules/madebyaris/poinf-of-sales/authentication-and-security-patterns/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/rules/madebyaris/poinf-of-sales/authentication-and-security-patterns"><img src="https://agentmods.dev/badge/rules/madebyaris/poinf-of-sales/authentication-and-security-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.02998 |
| Opus 5 | $0.00000 | $0.01499 |
| Sonnet 5 | $0.00000 | $0.00600 |
| Haiku 4.5 | $0.00000 | $0.00300 |
Grade A, and why
authentication-and-security-patterns scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
this.client = axios.create({ How it starts
The opening of the file, as written. The whole thing — 450 lines — stays where its author put it; the contents beside it link to each section on GitHub.
🔐 Authentication & Security Patterns
🚀 Essential Authentication Architecture
JWT-Based Authentication Flow
// Complete authentication workflow
class APIClient {
constructor() {
const apiUrl = import.meta.env?.VITE_API_URL || 'http://localhost:8080/api/v1';
console.log('🔧 API Client baseURL:', apiUrl);
this.client = axios.create({
baseURL: apiUrl,
timeout: 30000,
headers: { 'Content-Type': 'application/json' }
});
// Auto-attach token from localStorage
this.loadStoredAuth();
}
private loadStoredAuth(): void {
const token = localStorage.getItem('pos_token');
if (token) {
this.client.defaults.headers.common['Authorization'] = `Bearer ${token}`;
}
}
setAuthToken(token: string): void {
localStorage.setItem('pos_token', token);
this.client.defaults.headers.common['Authorization'] = `Bearer ${token}`;
}
clearAuth(): void {
localStorage.removeItem('pos_token');
localStorage.removeItem('pos_user');
delete this.client.defaults.headers.common['Authorization'];
}
isAuthenticated(): boolean {
return !!localStorage.getItem('pos_token');
}
}
🏗️ React Authentication Components
Protected Route Pattern (Avoid Infinite Redirects)
function HomePage() {
// ✅ ALL HOOKS AT TOP LEVEL - NEVER after returns
const [user, setUser] = useState<User | null>(null);
const [isLoadingAuth, setIsLoadingAuth] = useState(true); // Critical: Start true
const { isLoading: isVerifying, error } = useQuery({
queryKey: ['currentUser'],
queryFn: () => apiClient.getCurrentUser(),
enabled: false, // Control when to verify
retry: 1,
});
// Load auth state from localStorage FIRST
useEffect(() => {
const loadAuthState = async () => {
const token = localStorage.getItem('pos_token');
const storedUser = localStorage.getItem('pos_user');
console.log('🔍 Loading auth - token:', token ? 'exists' : 'missing');
console.log('🔍 Loading auth - user:', storedUser ? 'exists' : 'missing');
if (storedUser && token) {
try {
const parsedUser = JSON.parse(storedUser);
setUser(parsedUser);
console.log('✅ Auth loaded - user role:', parsedUser.role);
} catch (error) {
console.error('❌ Invalid stored auth data, clearing');
apiClient.clearAuth();
}
}
setIsLoadingAuth(false);
};
loadAuthState();
}, []);
// ✅ CRITICAL: Wait for localStorage loading before auth checks
if (isLoadingAuth) {
return <LoadingSpinner message="Loading authentication..." />;
}
// Only check auth AFTER loading is complete
if (!apiClient.isAuthenticated() || !user) {
console.log('🔄 Not authenticated, redirecting to login');
return <Navigate to="/login" replace />;
}
// Render protected content with user context
return <RoleBasedLayout user={user} />;
}
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 11d ago First seen · 450 lines · 2,998 tokens per session scan A db7a20e17e53
authentication-and-security-patterns is a cursor rule published in the GitHub repository madebyaris/poinf-of-sales (142 stars, last pushed 1y ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,998 tokens. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other cursor rules, from other repositories
ponytail
Ponytail, lazy senior dev mode. Always pick the simplest solution that works.
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.
cli-error-handling
CLI command error handling patterns.
prefer-direct-imports-over-module-mocks
Prefer extracting a testable core over vi.mock / vi.resetModules when unit tests need to reach production logic entangled with config, env, or singletons.
control-plane-descriptors
Control plane descriptor and instance implementation patterns.