fix(portfolio): User /:username routes as previously (#17470)
This commit is contained in:
committed by
Stuart Taylor
parent
a8756d5919
commit
259a0a594e
@ -3,5 +3,5 @@ import { types } from './redux';
|
||||
export { default } from './Profile.jsx';
|
||||
|
||||
export const routes = {
|
||||
[types.onRouteProfile]: '/portfolio/:username'
|
||||
[types.onRouteProfile]: '/:username'
|
||||
};
|
||||
|
@ -77,7 +77,7 @@ export class Settings extends React.Component {
|
||||
return (
|
||||
<div className={ `${ns}-container` }>
|
||||
<FullWidthRow>
|
||||
<Link to={ `/portfolio/${username}` }>
|
||||
<Link to={ `/${username}` }>
|
||||
<Button
|
||||
block={ true }
|
||||
bsSize='lg'
|
||||
|
@ -19,7 +19,7 @@ const isDev = process.env.NODE_ENV !== 'production';
|
||||
const routes = [
|
||||
'/settings',
|
||||
'/settings/*',
|
||||
'/portfolio/:username'
|
||||
'/:username'
|
||||
];
|
||||
|
||||
const devRoutes = [];
|
||||
@ -37,6 +37,11 @@ export default function reactSubRouter(app) {
|
||||
(req, res) => res.redirect(`/challenges/${req.params.dashedName}`)
|
||||
);
|
||||
|
||||
router.get(
|
||||
'/portfolio/:redirectUsername',
|
||||
(req, res) => res.redirect(`/${req.params.redirectUsername}`)
|
||||
);
|
||||
|
||||
// These routes are in production
|
||||
routes.forEach((route) => {
|
||||
router.get(route, serveReactApp);
|
@ -1,38 +1,52 @@
|
||||
export const blacklistedUsernames = [
|
||||
'bonfire',
|
||||
'about',
|
||||
'account',
|
||||
'user',
|
||||
'agile',
|
||||
'api',
|
||||
'bonfire',
|
||||
'cats.json',
|
||||
'challenge',
|
||||
'challenges',
|
||||
'completed-challenge',
|
||||
'completed-zipline-or-basejump',
|
||||
'completed-bonfire',
|
||||
'map',
|
||||
'learn-to-code',
|
||||
'about',
|
||||
'api',
|
||||
'explorer',
|
||||
'field-guide',
|
||||
'completed-field-guide',
|
||||
'jobs',
|
||||
'nonprofits',
|
||||
'sitemap.xml',
|
||||
'get-help',
|
||||
'chat',
|
||||
'twitch',
|
||||
'get-pai',
|
||||
'completed-bonfire',
|
||||
'completed-challenge',
|
||||
'completed-field-guide',
|
||||
'completed-zipline-or-basejump',
|
||||
'donate',
|
||||
'events',
|
||||
'explorer',
|
||||
'external',
|
||||
'field-guide',
|
||||
'forgot',
|
||||
'forum',
|
||||
'get-help',
|
||||
'get-help',
|
||||
'get-pai',
|
||||
'guide',
|
||||
'internal',
|
||||
'jobs',
|
||||
'jobs-form',
|
||||
'learn-to-code',
|
||||
'login',
|
||||
'logout',
|
||||
'map',
|
||||
'news',
|
||||
'nonprofits',
|
||||
'nonprofits',
|
||||
'nonproifts-form',
|
||||
'jobs-form',
|
||||
'unsubscribe',
|
||||
'unsubscribed',
|
||||
'cats.json',
|
||||
'agile',
|
||||
'open-api',
|
||||
'privacy',
|
||||
'stories',
|
||||
'privacy',
|
||||
'reset',
|
||||
'services',
|
||||
'signin',
|
||||
'signout',
|
||||
'forgot',
|
||||
'reset'
|
||||
'sitemap.xml',
|
||||
'stories',
|
||||
'terms',
|
||||
'twitch',
|
||||
'unsubscribe',
|
||||
'unsubscribed',
|
||||
'user',
|
||||
'wiki'
|
||||
];
|
||||
|
Reference in New Issue
Block a user