Skip to content

Commit 9b6f061

Browse files
committed
fix: add sanctum token auth
1 parent 1d07784 commit 9b6f061

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/module.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const defaultModuleOptions: ModuleOptions = {
1919
scheme: 'https',
2020
transports: ['ws', 'wss'],
2121
authentication: {
22+
mode: 'cookie',
2223
baseUrl: 'http://localhost:80',
2324
authEndpoint: '/broadcasting/auth',
2425
csrfEndpoint: '/sanctum/csrf-cookie',

src/runtime/plugin.client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function createFetchClient(
3636

3737
async onRequest(context) {
3838
// todo: move this to interceptors
39-
if (authentication.mode === 'token') {
39+
if (authentication.mode === 'cookie') {
4040
let csrfToken = readCsrfCookie(authentication.csrfCookie)
4141

4242
if (!csrfToken.value) {

0 commit comments

Comments
 (0)