コード例 #1
0
ファイル: views.py プロジェクト: Davidslc/SwapShop
def obtain_user_from_token(request):
    auth = TokenAuthentication()
    response = auth.authenticate_credentials(request.DATA['token'])

    user_id = response[0].id

    return HttpResponse(user_id)
コード例 #2
0
def obtain_user_from_token(r, token):
    auth = TokenAuthentication()
    response = auth.authenticate_credentials(token)
    user_id = response[0].id
    return Response(user_id)
コード例 #3
0
ファイル: views.py プロジェクト: henry1526/sprout
def obtain_user_from_token(r, token):
    auth = TokenAuthentication()
    response = auth.authenticate_credentials(token)
    user_id = response[0].id
    return Response(user_id)