-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automated update of shared files from the social-core repository, see https://github.com/python-social-auth/.github/blob/main/repo-sync.py
- Loading branch information
Showing
7 changed files
with
98 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,39 @@ | ||
# -*- coding: utf-8 -*- | ||
"""Setup file for easy installation""" | ||
from os.path import join, dirname | ||
|
||
from os.path import dirname, join | ||
|
||
from setuptools import setup | ||
|
||
|
||
def long_description(): | ||
return open(join(dirname(__file__), 'README.md')).read() | ||
return open(join(dirname(__file__), "README.md")).read() | ||
|
||
|
||
def load_requirements(): | ||
return open(join(dirname(__file__), 'requirements.txt')).readlines() | ||
return open(join(dirname(__file__), "requirements.txt")).readlines() | ||
|
||
|
||
setup( | ||
name='social-auth-app-flask', | ||
version=__import__('social_flask').__version__, | ||
author='Matias Aguirre', | ||
author_email='[email protected]', | ||
description='Python Social Authentication, Flask integration.', | ||
license='BSD', | ||
keywords='flask, social auth', | ||
url='https://github.com/python-social-auth/social-app-flask', | ||
packages=['social_flask'], | ||
name="social-auth-app-flask", | ||
version=__import__("social_flask").__version__, | ||
author="Matias Aguirre", | ||
author_email="[email protected]", | ||
description="Python Social Authentication, Flask integration.", | ||
license="BSD", | ||
keywords="flask, social auth", | ||
url="https://github.com/python-social-auth/social-app-flask", | ||
packages=["social_flask"], | ||
long_description=long_description(), | ||
install_requires=load_requirements(), | ||
classifiers=[ | ||
'Development Status :: 4 - Beta', | ||
'Topic :: Internet', | ||
'License :: OSI Approved :: BSD License', | ||
'Intended Audience :: Developers', | ||
'Environment :: Web Environment', | ||
'Programming Language :: Python', | ||
'Programming Language :: Python :: 2.7', | ||
'Programming Language :: Python :: 3' | ||
"Development Status :: 4 - Beta", | ||
"Topic :: Internet", | ||
"License :: OSI Approved :: BSD License", | ||
"Intended Audience :: Developers", | ||
"Environment :: Web Environment", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 2.7", | ||
"Programming Language :: Python :: 3", | ||
], | ||
zip_safe=False | ||
zip_safe=False, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = '1.0.0' | ||
__version__ = "1.0.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,28 @@ | ||
from flask import g, request | ||
|
||
from social_core.backends.utils import user_backends_data | ||
|
||
from social_flask.utils import get_helper | ||
|
||
|
||
def backends(): | ||
"""Load Social Auth current user data to context under the key 'backends'. | ||
Will return the output of social.backends.utils.user_backends_data.""" | ||
""" | ||
Load Social Auth current user data to context under the key 'backends'. | ||
Will return the output of social.backends.utils.user_backends_data. | ||
""" | ||
return { | ||
'backends': user_backends_data(g.user, | ||
get_helper('AUTHENTICATION_BACKENDS'), | ||
get_helper('STORAGE', do_import=True)) | ||
"backends": user_backends_data( | ||
g.user, | ||
get_helper("AUTHENTICATION_BACKENDS"), | ||
get_helper("STORAGE", do_import=True), | ||
) | ||
} | ||
|
||
|
||
def login_redirect(): | ||
"""Load current redirect to context.""" | ||
value = request.form.get('next', '') or \ | ||
request.args.get('next', '') | ||
value = request.form.get("next", "") or request.args.get("next", "") | ||
return { | ||
'REDIRECT_FIELD_NAME': 'next', | ||
'REDIRECT_FIELD_VALUE': value, | ||
'REDIRECT_QUERYSTRING': value and ('next=' + value) or '' | ||
"REDIRECT_FIELD_NAME": "next", | ||
"REDIRECT_FIELD_VALUE": value, | ||
"REDIRECT_QUERYSTRING": (value and ("next=" + value)) or "", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters