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.
1 parent 8138e1f commit 31a1098Copy full SHA for 31a1098
lib/plugin.js
@@ -12,11 +12,17 @@ function getHeaders ({ app }) {
12
<% if (options.authModule) { %>
13
if (app.$auth) {
14
const strategy = app.$auth.strategy
15
- const tokenName = strategy.options.tokenName || 'Authorization'
16
- const token = app.$auth.getToken(strategy.name)
17
18
- if (token) {
19
- headers[tokenName] = token
+ if (strategy.options.name === 'laravelSanctum') {
+ headers.referer = location.origin
+ headers['X-XSRF-TOKEN'] = app.$auth.$storage.getCookies()['XSRF-TOKEN']
+ } else {
20
+ const tokenName = strategy.options.token.name || 'Authorization'
21
+ const token = app.$auth.strategy.token.get()
22
+
23
+ if (token) {
24
+ headers[tokenName] = token
25
+ }
26
}
27
28
<% } %>
0 commit comments