summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2020-07-09 00:29:49 -0700
committerBryan Newbold <bnewbold@robocracy.org>2020-07-09 00:29:49 -0700
commitecd9359833ea83e8422ddb7496853719ca83cb21 (patch)
tree3c9391c02c582ca937d40ea9653edbb00f7dba1b
parent1bc66d16f6cec4cf61592639815e0f69b993155a (diff)
downloadfatcat-ecd9359833ea83e8422ddb7496853719ca83cb21.tar.gz
fatcat-ecd9359833ea83e8422ddb7496853719ca83cb21.zip
get mediawiki username creation working with spaces
-rw-r--r--python/fatcat_web/auth.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/python/fatcat_web/auth.py b/python/fatcat_web/auth.py
index 268bc1c4..ed9f2252 100644
--- a/python/fatcat_web/auth.py
+++ b/python/fatcat_web/auth.py
@@ -140,8 +140,9 @@ def handle_wmoauth(username):
# pass off "as if" we did OAuth successfully
FakeOAuthRemote = namedtuple('FakeOAuthRemote', ['name', 'OAUTH_CONFIG'])
remote = FakeOAuthRemote(name='wikipedia', OAUTH_CONFIG={'api_base_url': "https://www.mediawiki.org/w"})
+ conservative_username = ''.join(filter(str.isalnum, username))
oauth_info = {
- 'preferred_username': username,
+ 'preferred_username': conservative_username,
'iss': "https://www.mediawiki.org/w",
'sub': username,
}