Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added twitter oauth 1.0 and 2.0 #424

Closed
wants to merge 1 commit into from

Conversation

kotyatokino
Copy link

I just confirmed twitter oauth 1.0 and 2.0 login.
And I'm not native speaker of English. So please help me to fix variable name or some naming part for native speakers.

and userland test code like this.

from flask_dance.contrib.twitter import make_twitter2_blueprint as make_bp, twitter2 as sns
bp = make_bp(
api_key=mcfg.strTWappid,
api_secret=mcfg.strTWappsec,
scope="tweet.read users.read offline.access",
redirect_url="/captiveportal/twitter2",
authorized_url="/authorized"
)

:
:
me = None
try:
me = sns.get("2/users/me")
except Exception as e:
g.ilog("Twitter Logged in but something wrong(%s). Redirect to loginpage(%s,%
s)" % (str(e),tupURL[1]["usermac"],tupURL[1]["magic"]))
return redirect(url_for("%s.login" % strSNSname))

if(me.status_code < 200 or me.status_code >= 300):
    g.elog("Twitter auth failed redirect to login: %s ( %s )(%s,%s)" % (me.text,m\

e.status_code,tupURL[1]["usermac"],tupURL[1]["magic"]))
return redirect(url_for("%s.login" % strSNSname))

j = me.json()

Copy link

codecov bot commented Nov 12, 2023

Codecov Report

Merging #424 (ae51d3d) into main (27add75) will decrease coverage by 7.93%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main     #424      +/-   ##
==========================================
- Coverage   96.35%   88.43%   -7.93%     
==========================================
  Files          37       38       +1     
  Lines        1070     1098      +28     
==========================================
- Hits         1031      971      -60     
- Misses         39      127      +88     
Files Coverage Δ
flask_dance/contrib/twitter.py 0.00% <0.00%> (ø)

... and 30 files with indirect coverage changes

📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today!

@singingwolfboy
Copy link
Owner

It doesn't make sense to have both OAuth 1 and OAuth 2 for a single provider. This code is missing tests and documentation. The linter is failing. In addition, I don't want to be the maintainer for this code, so my email address does not belong in the __maintainer__ variable.

Frankly, I don't want to support Twitter in this library anymore. I'm not happy with the way that Elon Musk has been running it, and I've stopped using it myself.

@kotyatokino
Copy link
Author

Frankly, I don't want to support Twitter in this library anymore. I'm not happy with the way that Elon Musk has been running it, and I've stopped using it myself.

I would like to know your thoughts before writing the code. I don't want to cause you any trouble, so I'd like to close this pull request. I don't have as much skill as you, so I don't think I can maintain it at the same level as you. I can write my own program to solve the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants