Skip to content

Commit

Permalink
CHG log error on linked github account
Browse files Browse the repository at this point in the history
  • Loading branch information
wabscale committed Feb 2, 2024
1 parent e5ac315 commit ff76b82
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions api/anubis/views/public/auth.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import traceback
from urllib.parse import urlunparse
from urllib.parse import quote

Expand All @@ -8,7 +9,6 @@
from anubis.env import env
from anubis.lms.courses import get_course_context
from anubis.models import User, db, UserSource
from anubis.utils.auth.http import require_user
from anubis.utils.auth.oauth import OAUTH_REMOTE_APP_GITHUB as github_provider
from anubis.utils.auth.oauth import OAUTH_REMOTE_APP_NYU as nyu_provider
from anubis.utils.auth.token import create_token
Expand All @@ -17,6 +17,8 @@
from anubis.utils.http import success_response, get_string_arg
from anubis.utils.exceptions import AuthenticationError
from anubis.utils.config import get_config_str
from anubis.utils.logging import logger


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

# Return rseponse
# Return response
return r

# Notify them with status
return redirect(next_url)
except:
except Exception as e:
logger.error(traceback.format_exc())
return redirect(next_url + '?error=Unable to set username')


Expand Down

0 comments on commit ff76b82

Please sign in to comment.