We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
laravelSanctum
1 parent 79c7b36 commit 15cc82bCopy full SHA for 15cc82b
lib/plugin.js
@@ -15,12 +15,16 @@ function getHeaders ({ app }) {
15
<% if (options.authModule) { %>
16
if (app.$auth) {
17
const strategy = app.$auth.strategy
18
- const tokenName = strategy.options.token.name || 'Authorization'
19
- const token = app.$auth.token.get()
20
21
- if (token) {
22
- headers[tokenName] = token
+ if (strategy.options.name === 'laravelSanctum') {
23
headers['X-XSRF-TOKEN'] = app.$auth.$storage.getCookies()['XSRF-TOKEN']
+ } else {
+ const tokenName = strategy.options.token.name || 'Authorization'
+ const token = app.$auth.token.get()
24
+
25
+ if (token) {
26
+ headers[tokenName] = token
27
+ }
28
}
29
30
<% } %>
0 commit comments