0

I am looking at a pretty outdated tutorial here. My question though, only relates to a snippet of this code, particularly this snippet:

class InviteMiddleware(object):

    def process_request(self, req):
        if req.path == '/i.auth'
            return None
        if not req.user.is_authenticated():
            if 'token' in req.COOKIES:
                return redirect(reverse('invite_reg_user'))
        return None

specifically this line:

if req.path == '/i.auth'

What is the path /i.auth? How is this being used and why did the author of this article check the path using this? I have searched the internet and it seems like i.auth doesn't necessarily pertain to anything. What is the author really trying to check?

John Vinyard
  • 12,997
  • 3
  • 30
  • 43
ApathyBear
  • 9,057
  • 14
  • 56
  • 90

1 Answers1

0

My guess is that the author took the middleware from an existing project that uses /i.auth for some view and that this middleware should be bypassed when that view is requested. He simply forgot to remove this bit of code when he published the article.

Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358