Ejemplo n.º 1
0
def create_session_token(sender, user, request, **kwargs):
    auth_token = AuthToken(user=user, api_server_url=settings.API_SERVER_URL)
    auth_token.update_expiration()
    auth_token.save()
    request.session['username'] = auth_token.user.username
    request.session['token'] = auth_token.key
    return auth_token
Ejemplo n.º 2
0
def createAuthToken(username):
    """
    returns a new token for username
    """
    user = User.objects.get(username=username)
    auth_user_token = AuthToken(user=user,
                                api_server_url=settings.API_SERVER_URL)
    auth_user_token.update_expiration()
    auth_user_token.save()
    return auth_user_token
Ejemplo n.º 3
0
def create_session_token(sender, user, request, **kwargs):
    auth_token = AuthToken(
        user=user,
        api_server_url=settings.API_SERVER_URL
    )
    auth_token.update_expiration()
    auth_token.save()
    request.session['username'] = auth_token.user.username
    request.session['token'] = auth_token.key
    return auth_token
Ejemplo n.º 4
0
def createAuthToken(username):
    """
    returns a new token for username
    """
    user = User.objects.get(username=username)
    auth_user_token = AuthToken(
        user=user,
        api_server_url=settings.API_SERVER_URL
    )
    auth_user_token.update_expiration()
    auth_user_token.save()
    return auth_user_token
Ejemplo n.º 5
0
def createAuthToken(username):
    """
    returns a new token for username
    """
    # NOTE: REMOVE this when it is no longer true!
    # Force any username lookup to be in lowercase
    if not username:
        return None
    username = username.lower()

    user = User.objects.get(username=username)
    auth_user_token = AuthToken(user=user,
                                api_server_url=settings.API_SERVER_URL)
    auth_user_token.update_expiration()
    auth_user_token.save()
    return auth_user_token
Ejemplo n.º 6
0
def createAuthToken(username):
    """
    returns a new token for username
    """
    # NOTE: REMOVE this when it is no longer true!
    # Force any username lookup to be in lowercase
    if not username:
        return None
    username = username.lower()

    user = User.objects.get(username=username)
    auth_user_token = AuthToken(
        user=user,
        api_server_url=settings.API_SERVER_URL
    )
    auth_user_token.update_expiration()
    auth_user_token.save()
    return auth_user_token