UNPKG

@userfrosting/sprinkle-core

Version:
19 lines (18 loc) 740 B
/** * CSRF Protection Composable * * Automatically sets the CSRF token in the axios headers for all requests. * The CSRF token is read from the meta tags in the HTML document. * The CSRF token can updated when the server responds with a new token in the headers. * * @see https://cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html#axios */ export declare const useCsrf: () => { key_name: import('vue').Ref<string, string>; key_value: import('vue').Ref<string, string>; name: import('vue').Ref<string, string>; token: import('vue').Ref<string, string>; isEnabled: () => boolean; updateFromHeaders: (headers: any) => void; fetchCsrfToken: () => Promise<void>; };