aboutsummaryrefslogtreecommitdiffstats
path: root/python/fatcat_web/auth.py
diff options
context:
space:
mode:
authorMartin Czygan <martin@archive.org>2020-07-10 21:32:41 +0000
committerMartin Czygan <martin@archive.org>2020-07-10 21:32:41 +0000
commit3c266e07771271241aa8cff3e3199a45109362af (patch)
tree73fa6aedf1bbfeffeac9c94593f5f9c4f2dd645b /python/fatcat_web/auth.py
parentfdf1028c19b0623e30b91e49ffa65ed130dcfdc1 (diff)
parentc9d8550be4bab808c2bad0b0d3642a71075202c0 (diff)
downloadfatcat-3c266e07771271241aa8cff3e3199a45109362af.tar.gz
fatcat-3c266e07771271241aa8cff3e3199a45109362af.zip
datacite: resolve formatting issues in tests
Diffstat (limited to 'python/fatcat_web/auth.py')
-rw-r--r--python/fatcat_web/auth.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/python/fatcat_web/auth.py b/python/fatcat_web/auth.py
index 8e26b7fe..ed9f2252 100644
--- a/python/fatcat_web/auth.py
+++ b/python/fatcat_web/auth.py
@@ -2,8 +2,7 @@
from collections import namedtuple
import requests
import pymacaroons
-from flask import Flask, render_template, send_from_directory, request, \
- url_for, abort, g, redirect, jsonify, session, flash
+from flask import render_template, abort, redirect, session, flash
from flask_login import logout_user, login_user, UserMixin
from fatcat_web import login_manager, app, api, priv_api, Config
import fatcat_openapi_client
@@ -141,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,
}