Exemplo n.º 1
0
def complete(request, backend, *args, **kwargs):
    """Authentication complete view, override this view if transaction
    management doesn't suit your needs."""
    if request.user.is_authenticated():
        return associate_complete(request, backend, *args, **kwargs)
    else:
        return complete_process(request, backend, *args, **kwargs)
Exemplo n.º 2
0
def associate_complete_wrapper(request, backend):
    try:
        return associate_complete(request, backend)
    except ValueError, e:
        if e and len(e.args) > 0:
            if e[0] == 'Account already in use.':
                messages.error(request, "Authentication already used on account: %s" % e[1])
Exemplo n.º 3
0
def login_done(request, backend, *args, **kwargs):
    if request.user.is_authenticated():
        return associate_complete(request, backend, *args, **kwargs)
    else:
        try:
            return complete_process(request, backend, *args, **kwargs)
        except Exception, e:
            logger.exception(e)
            return html_response('login.html', {'at_login': True, 'error': str(e)}, request)
Exemplo n.º 4
0
def socialauth_complete(request, backend, *args, **kwargs):
    """
    Authentication complete process -- override from the
       default in django-social-auth to:
        -- collect phone numbers on registration
        -- integrate with django-registration in order
           to confirm email for new users
    """ 
    if request.user.is_authenticated():
        return sviews.associate_complete(request, backend, *args, **kwargs)
    else:
        return complete_process(request, backend, *args, **kwargs)