Skip to content

Commit ff76b82

Browse files
committed
CHG log error on linked github account
1 parent e5ac315 commit ff76b82

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

api/anubis/views/public/auth.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import traceback
12
from urllib.parse import urlunparse
23
from urllib.parse import quote
34

@@ -8,7 +9,6 @@
89
from anubis.env import env
910
from anubis.lms.courses import get_course_context
1011
from anubis.models import User, db, UserSource
11-
from anubis.utils.auth.http import require_user
1212
from anubis.utils.auth.oauth import OAUTH_REMOTE_APP_GITHUB as github_provider
1313
from anubis.utils.auth.oauth import OAUTH_REMOTE_APP_NYU as nyu_provider
1414
from anubis.utils.auth.token import create_token
@@ -17,6 +17,8 @@
1717
from anubis.utils.http import success_response, get_string_arg
1818
from anubis.utils.exceptions import AuthenticationError
1919
from anubis.utils.config import get_config_str
20+
from anubis.utils.logging import logger
21+
2022

2123
auth_ = Blueprint("public-auth", __name__, url_prefix="/public/auth")
2224
nyu_oauth_ = Blueprint("public-oauth", __name__, url_prefix="/public")
@@ -201,12 +203,13 @@ def public_github_oauth():
201203
token = create_token(user.netid)
202204
r.set_cookie("token", token, httponly=True)
203205

204-
# Return rseponse
206+
# Return response
205207
return r
206208

207209
# Notify them with status
208210
return redirect(next_url)
209-
except:
211+
except Exception as e:
212+
logger.error(traceback.format_exc())
210213
return redirect(next_url + '?error=Unable to set username')
211214

212215

0 commit comments

Comments
 (0)