Skip to content
This repository was archived by the owner on Jan 11, 2022. It is now read-only.

auth: create_token fn to create token for gistey#45

Open
meetmangukiya wants to merge 1 commit intomasterfrom
meet/gh-token
Open

auth: create_token fn to create token for gistey#45
meetmangukiya wants to merge 1 commit intomasterfrom
meet/gh-token

Conversation

@meetmangukiya
Copy link
Owner

@meetmangukiya meetmangukiya commented Dec 21, 2016

Closes #44


This change is Reviewable

gistey/auth.py Outdated
headers={"X-GitHub-OTP": otp})

return rq
#TODO Returns 404 =/ Confusing
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix this!

@meetmangukiya meetmangukiya reopened this Dec 22, 2016
return partial(func, auth=(username, password))


@authorize
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There seems to be a problem in making authorize function as the decorator.
Because currently, the decorator right away asks for username and password instead of asking at function call.


if "X-GitHub-OTP" in rq.headers:
otp = input("Enter 2FA code: ")
rq = requests.put(end + "authorizations/", params=params, auth=auth,
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to post

end = "https://api.github.com/"


def authorize(func):
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Completely remove it for now, if needed we will introduce in future

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant