Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User Authentication #340

Merged
merged 4 commits into from
Jun 7, 2022
Merged

User Authentication #340

merged 4 commits into from
Jun 7, 2022

Conversation

rennokki
Copy link
Contributor

@rennokki rennokki commented Jun 2, 2022

@rennokki rennokki marked this pull request as draft June 2, 2022 15:48
@rennokki rennokki marked this pull request as ready for review June 2, 2022 19:05
@driesvints driesvints changed the title [feature] User Authentication User Authentication Jun 3, 2022
@taylorotwell
Copy link
Member

So how would we ensure people have Pusher JS SDK 7.1+ installed?

@rennokki
Copy link
Contributor Author

rennokki commented Jun 7, 2022

@taylorotwell

  • The signin() prototype does not exist pre 7.1-beta. It's optional.
  • This PR just adds the default endpoints that do not break already-existing apps. For apps that want to upgrade to JS SDK 7.1+, the defaults will point to the right user authentication endpoint. The endpoints are called only when signin() is used.

@taylorotwell taylorotwell merged commit 4a0ac55 into laravel:master Jun 7, 2022
@rennokki rennokki deleted the patch-1 branch June 7, 2022 20:27
@jose123v
Copy link

Hi @rennokki, thanks for the great work

How to use this in soketi? is any change needed?


if (token) {
this.options.auth.headers['X-CSRF-TOKEN'] = token;
this.options.userAuthentication.headers['X-CSRF-TOKEN'] = token;
}
Copy link

@jose123v jose123v Jul 20, 2022

Choose a reason for hiding this comment

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

@rennokki
What about bearer token support?

broadcaster: 'pusher',
csrfToken: null,
host: null,

if (token) {
    this.options.auth.headers['X-CSRF-TOKEN'] = token;
    this.options.userAuthentication.headers['X-CSRF-TOKEN'] = token;
}

token = this.options.bearerToken;
if (token) {
    this.options.auth.headers['Authorization'] = 'Bearer '+ token;
    this.options.userAuthentication.headers['Authorization'] = 'Bearer '+ token;
}

Choose a reason for hiding this comment

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

@rennokki ping

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.

3 participants