Skip to content

Commit

Permalink
fix: Fix app manage page logout redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
leoliu committed Feb 21, 2020
1 parent b78985a commit 1c7dc61
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions server/libs/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ const isValidReferer = path =>
* @param path koa ctx.path
*/
const isAppsRoute = path => {
const regex = pathToRegex('/apps(/?.*)')
return regex.exec(path)
const regex = pathToRegex('/apps/app-(.*)')
return path === '/apps' || regex.exec(path)
}

/**
Expand Down
5 changes: 4 additions & 1 deletion src/components/Layout/LoginInfo/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,10 @@ export default class LoginInfo extends Component {
secondary: '#8d663e',
}}
/>
<a className={styles.loginLabel} href="/login?referer=/apps">
<a
className={styles.loginLabel}
href={`/login?referer=${location.pathname}`}
>
{t('Login KubeSphere')}
</a>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -456,4 +456,4 @@ export const withDryRun = async requests => {
* @param {String} path
*/
export const isAppsPage = (path = location.pathname) =>
path === '/apps' || path.startsWith('/apps/')
path === '/apps' || path.startsWith('/apps/app-')

0 comments on commit 1c7dc61

Please sign in to comment.