Skip to content
New issue

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

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

Already on GitHub? # to your account

Add support for authorizer #45

Open
ricardogobbosouza opened this issue Mar 29, 2021 · 2 comments
Open

Add support for authorizer #45

ricardogobbosouza opened this issue Mar 29, 2021 · 2 comments

Comments

@ricardogobbosouza
Copy link
Member

No description provided.

@ricardogobbosouza
Copy link
Member Author

ricardogobbosouza commented Mar 31, 2021

Hi @radudiaconu0, @farazappy
Try this version: 2.0.0-alpha.1
Added optionsPath like https://github.com/nuxt-community/vuetify-module#optionspath

// app/laravel-echo/options.js

export default /* async */ function (ctx) {
  return {
    authorizer (channel, options) {
      return {
        authorize (socketId, callback) {
          ctx.app.$axios.post(options.authEndpoint, {
            socket_id: socketId,
            channel_name: channel.name
          })
            .then((response) => {
              callback(false, response.data)
            })
            .catch((error) => {
              callback(true, error)
            })
        }
      }
    }
  }
}

PS: I need to update docs

@ricardogobbosouza
Copy link
Member Author

#47

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant