old_contents: from functools import wraps
  from website.exceptions import AuthenticationFailed
  
  from player.models import Room
  
  
  def room_required(func):
      @wraps(func)
      def wrap(request, **kwargs):
          try:
              room = Room.objects.get(name=request.session.get('room'))
          except:
              raise AuthenticationFailed()
  
          return func(request, room=room, **kwargs)
      return wrap
  
new_contents: from functools import wraps
  from website.exceptions import AuthenticationFailed
  
  from player.models import Room
  
  
  def room_required(func):
      @wraps(func)
      def wrap(request, **kwargs):
          try:
              room = Room.objects.get(token=request.session.get('token'))
          except:
              raise AuthenticationFailed()
  
          return func(request, room=room, **kwargs)
      return wrap
  
subject: check log on token, not room name ...