transmit icon indicating copy to clipboard operation
transmit copied to clipboard

transmit authorization always fail

Open EvanPerreau opened this issue 1 year ago • 11 comments

Package version

1.0.2

Describe the bug

Hello, I have a huge problem with the transmit authorization, I have a authorization for a channel :

image

with this policy (the policy always return true for debug)

image

when i try to connect my front end to the channel

image

but if I directly return true in the channel auth config :

image

it work 🙃

image

Reproduction repo

No response

EvanPerreau avatar Jun 29 '24 19:06 EvanPerreau

Hey @EvanPerreau! 👋🏻

Could you please provide a repository with the minimum amount of code to reproduce your issue? As per the Transmit codebase, it should work fine.

RomainLanz avatar Jul 02 '24 08:07 RomainLanz

Hey @RomainLanz , I guess this error is throw becasue i don't config the routeHandleModifier in transmit config. But, a new error appear : image image

EvanPerreau avatar Jul 04 '24 16:07 EvanPerreau

Are you sure you are not importing the kernel at the top of your file too?

RomainLanz avatar Jul 04 '24 18:07 RomainLanz

@RomainLanz it's my transmit.ts config file:

image

and my kernel.ts file : image

EvanPerreau avatar Jul 05 '24 11:07 EvanPerreau

You can notice that you are importing the middleware at the top of your file instead of in the callback. Please, check the documentation again.

📚 https://docs.adonisjs.com/guides/digging-deeper/transmit#configuration

RomainLanz avatar Jul 07 '24 07:07 RomainLanz

@RomainLanz I also have the error when I import middleware in the callback like the doc : image

image

EvanPerreau avatar Jul 07 '24 11:07 EvanPerreau

server is undefined

EvanPerreau avatar Jul 07 '24 12:07 EvanPerreau

That's weird, but let me devise a new way to modify the route. It will solve this issue.

Related: https://github.com/adonisjs/transmit/issues/26

RomainLanz avatar Jul 09 '24 06:07 RomainLanz

@RomainLanz ok tank's

EvanPerreau avatar Jul 09 '24 07:07 EvanPerreau

hey @RomainLanz, some good news about your modifications to solve this issue ?

EvanPerreau avatar Jul 19 '24 09:07 EvanPerreau

Hey @EvanPerreau! 👋🏻

Could you please try to install @adonisjs/transmit@next and add the following code to your route file:

import transmit from '@adonisjs/transmit/services/main'

transmit.registerRoute(() => {
  // Your route's customization code here
})

RomainLanz avatar Jul 30 '24 06:07 RomainLanz

Did you have the chance to try the new version? Do you have any feedback or issues before I make a final release?

RomainLanz avatar Aug 22 '24 13:08 RomainLanz

Hello, try to use the new version but I was not convinced, i switch to WebSocket

EvanPerreau avatar Aug 23 '24 12:08 EvanPerreau