Fix user redirects to go to the correct URL

`/user` no longer works and returns a 404; we now need to redirect to the specific user page
This commit is contained in:
Joseph Schorr 2016-11-28 18:55:41 -05:00
parent 1c3012a538
commit 0e24f6b40a
2 changed files with 8 additions and 12 deletions

View file

@ -15,7 +15,6 @@ from endpoints.web import render_page_template_with_routedata
from util.security.jwtutil import decode, InvalidTokenError
from util.validation import generate_valid_usernames
logger = logging.getLogger(__name__)
client = app.config['HTTPCLIENT']
oauthlogin = Blueprint('oauthlogin', __name__)
@ -229,7 +228,7 @@ def google_oauth_attach():
username, app.config['REGISTRY_TITLE_SHORT'])
return render_ologin_error('Google', err)
return redirect(url_for('web.user'))
return redirect(url_for('web.user_view', path=user_obj.username, tab='external'))
@oauthlogin.route('/github/callback/attach', methods=['GET'])
@ -258,7 +257,7 @@ def github_oauth_attach():
return render_ologin_error('GitHub', err)
return redirect(url_for('web.user'))
return redirect(url_for('web.user_view', path=user_obj.username, tab='external'))
def decode_user_jwt(token, oidc_provider):
@ -344,4 +343,5 @@ def dex_oauth_attach():
app.config['REGISTRY_TITLE_SHORT'])
return render_ologin_error(dex_login.public_title, err)
return redirect(url_for('web.user'))
return redirect(url_for('web.user_view', path=user_obj.username, tab='external'))