@http.never_ever_cache
    def get(self, request):
        token = request.GET.get('token')
        if token == None:
            return http.HttpResponseBadRequest('Token missing.')
        try:
            user = auth.authenticate(site=request.site,
                                     site_url=request.site_url,
                                     token=token)
        except AuthenticationError as ex:
            logger.debug('Token verification failed.')
            return http.HttpResponseBadRequest(str(ex))
        if user is not None:
            auth.login(request, user)

            # Store all user data needed by Auth view in session, this
            # way, user table does not need to be queried during the
            # performance critical request (sessions are cached).
            request.session['user_id'] = user.id
            logger.debug('%s successfully logged.' % (user.email))
            # TODO: validate path and set to '/' if invalid

            redirect_to = request.GET.get('next')
            if (redirect_to is None or
                not url_utils.validate_redirection_target(redirect_to)):
                redirect_to = '/'

            return http.HttpResponseRedirect(request.site_url + redirect_to)
        else:
            # Return not authorized because request was well formed (400
            # Unkown user.
            # doesn't seem appropriate).
            return http.HttpResponseNotAuthorized()
Registers a callback to be called when an event fires.
dataset/ETHPy150Open wrr/wwwhisper/wwwhisper_auth/views.py/LoginToken.get--crossover with--dataset/ETHPy150Open JohnMaguire/Cardinal/cardinal/plugins.py/EventManager.register_callback