mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-05 16:57:18 +02:00
Basic channels middleware for token auth
This commit is contained in:
parent
498aa1137b
commit
5c2ddc56c4
5 changed files with 138 additions and 0 deletions
17
api/config/routing.py
Normal file
17
api/config/routing.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
from django.conf.urls import url
|
||||
|
||||
from channels.auth import AuthMiddlewareStack
|
||||
from channels.routing import ProtocolTypeRouter, URLRouter
|
||||
|
||||
from funkwhale_api.common.auth import TokenAuthMiddleware
|
||||
from funkwhale_api.music import consumers
|
||||
|
||||
|
||||
application = ProtocolTypeRouter({
|
||||
# Empty for now (http->django views is added by default)
|
||||
"websocket": TokenAuthMiddleware(
|
||||
URLRouter([
|
||||
url("^api/v1/test/$", consumers.MyConsumer),
|
||||
])
|
||||
),
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue