NOOPDecorator#
@palmyralabs/palmyra-wire · lib/palmyra/store/auth/NoopDecorator.ts
Overview#
No-operation AuthDecorator — its decorate() method does nothing. Exported as a singleton (not a class) so every store can share the same instance without construction cost. This is the default decorator when none is supplied.
Use it when:
- Your API is session-cookie-based (the browser attaches
Set-Cookiecredentials automatically). - The backend and frontend share an origin / proxy, so no explicit auth header is needed.
- You’re adding auth via an
axiosCustomizeronStoreOptionsinstead.
Source#
class NoAuthDecorator implements AuthDecorator {
decorate(_request: any): void { }
}
const NOOPDecorator = new NoAuthDecorator();
export { NOOPDecorator };Example#
import { NOOPDecorator } from '@palmyralabs/palmyra-wire';
// Explicit — the same thing the factory falls back to when no decorator is set.
const request: any = { url: '/user', headers: {} };
NOOPDecorator.decorate(request);
// request is unchanged.