Use authentication for Django Channels
User tokens are currently managed by views by manually using request.token.user instead of request.user.
Django Channels does now have authentication infrastructure and at some point we may want to use that instead of effectively reimplementing a special case user auth from scratch.
Things to do:
-
Add Channels' infrastructure to our ASGI function -
Implement debusine.server.middlewares.token_last_seen_at.TokenLastSeenAtMiddlewareChannels.try_loginto interface with Channels' auth -
Update code to use request.userinstead ofrequest.token.user