def METHOD_NAME(oauth_token):
	if oauth_token is None:
		flash(gettext("Authorization failed [err=gh-oauth-login-failed]"), "danger")
		return redirect(url_for("users.login"))
	# Get GitGub username
	url = "https://api.github.com/user"
	r = requests.get(url, headers={"Authorization": "token " + oauth_token})
	username = r.json()["login"]
	# Get user by GitHub username
	userByGithub = User.query.filter(func.lower(User.github_username) == func.lower(username)).first()
	# If logged in, connect
	if current_user and current_user.is_authenticated:
		if userByGithub is None:
			current_user.github_username = username
			db.session.commit()
			flash(gettext("Linked GitHub to account"), "success")
			return redirect(url_for("homepage.home"))
		else:
			flash(gettext("GitHub account is already associated with another user"), "danger")
			return redirect(url_for("homepage.home"))
	# If not logged in, log in
	else:
		if userByGithub is None:
			flash(gettext("Unable to find an account for that GitHub user"), "danger")
			return redirect(url_for("users.claim_forums"))
		ret = login_user_set_active(userByGithub, remember=True)
		if ret is None:
			flash(gettext("Authorization failed [err=gh-login-failed]"), "danger")
			return redirect(url_for("users.login"))
		add_audit_log(AuditSeverity.USER, userByGithub, "Logged in using GitHub OAuth",
					  url_for("users.profile", username=userByGithub.username))
		db.session.commit()
		return ret