|
| 1 | +import traceback |
1 | 2 | from urllib.parse import urlunparse
|
2 | 3 | from urllib.parse import quote
|
3 | 4 |
|
|
8 | 9 | from anubis.env import env
|
9 | 10 | from anubis.lms.courses import get_course_context
|
10 | 11 | from anubis.models import User, db, UserSource
|
11 |
| -from anubis.utils.auth.http import require_user |
12 | 12 | from anubis.utils.auth.oauth import OAUTH_REMOTE_APP_GITHUB as github_provider
|
13 | 13 | from anubis.utils.auth.oauth import OAUTH_REMOTE_APP_NYU as nyu_provider
|
14 | 14 | from anubis.utils.auth.token import create_token
|
|
17 | 17 | from anubis.utils.http import success_response, get_string_arg
|
18 | 18 | from anubis.utils.exceptions import AuthenticationError
|
19 | 19 | from anubis.utils.config import get_config_str
|
| 20 | +from anubis.utils.logging import logger |
| 21 | + |
20 | 22 |
|
21 | 23 | auth_ = Blueprint("public-auth", __name__, url_prefix="/public/auth")
|
22 | 24 | nyu_oauth_ = Blueprint("public-oauth", __name__, url_prefix="/public")
|
@@ -201,12 +203,13 @@ def public_github_oauth():
|
201 | 203 | token = create_token(user.netid)
|
202 | 204 | r.set_cookie("token", token, httponly=True)
|
203 | 205 |
|
204 |
| - # Return rseponse |
| 206 | + # Return response |
205 | 207 | return r
|
206 | 208 |
|
207 | 209 | # Notify them with status
|
208 | 210 | return redirect(next_url)
|
209 |
| - except: |
| 211 | + except Exception as e: |
| 212 | + logger.error(traceback.format_exc()) |
210 | 213 | return redirect(next_url + '?error=Unable to set username')
|
211 | 214 |
|
212 | 215 |
|
|
0 commit comments