Skip to content

Use the Authentication Guard that is defined in the users config file.#107

Merged
duncanmcclean merged 2 commits intostatamic:masterfrom
tao:patch-1
Jun 30, 2025
Merged

Use the Authentication Guard that is defined in the users config file.#107
duncanmcclean merged 2 commits intostatamic:masterfrom
tao:patch-1

Conversation

@tao
Copy link
Copy Markdown
Contributor

@tao tao commented Jun 27, 2025

When you customise the Authentication Guards the collaboration plugin fails to load correctly and continues to show the message "Attempting websocket connection..."

Screenshot 2025-06-27 at 16 33 55

This happens because the POST request to /broadcasting/auth fails with a 403 error.

Screenshot 2025-06-27 at 16 27 29

By updating the channel to be aware of the guards that are defined in the users config file, the user is able to authenticate correctly and the collaboration plugin connection works again.

Screenshot 2025-06-27 at 16 32 29

This example is from the docs for Using an Independent Authentication Guard. If you use a custom guard as this tutorial in the documentation describes then the collaboration plugin doesn't work anymore.

// config/statamic/users.php
 
'guards' => [
    'cp' => 'statamic',
    'web' => 'web',
],

While the default config is to use the web authentication guard

    'guards' => [
        'cp' => 'web',
        'web' => 'web',
    ],

Closes #106

tao and others added 2 commits June 27, 2025 16:22
Use Authentication Guard defined in the configuration file.
Copy link
Copy Markdown
Member

@duncanmcclean duncanmcclean left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@duncanmcclean duncanmcclean merged commit 141bcec into statamic:master Jun 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Guard for Eloquent Users and Non-Default Laravel Auth

2 participants