Skip to content

Commit

Permalink
fix: wrong router navigation when redirect to /uc (#5609)
Browse files Browse the repository at this point in the history
#### What type of PR is this?

/kind bug
/area ui

#### What this PR does / why we need it:

修复当角色勾选禁止访问 Console 后,redirect_uri 参数无效的问题

#### How to test it?

测试角色禁止访问 console 时,当链接中携带 redirect_uri 参数,能否正常跳转

#### Which issue(s) this PR fixes:

Fixes #5417 

#### Does this PR introduce a user-facing change?
```release-note
修复当角色禁止访问 Console 后,redirect_uri 参数无效的问题
```
  • Loading branch information
LIlGG committed Mar 27, 2024
1 parent 2011435 commit ec4c390
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ui/console-src/router/guards/auth-check.ts
Expand Up @@ -2,7 +2,7 @@ import { rbacAnnotations } from "@/constants/annotations";
import { useUserStore } from "@/stores/user";
import type { Router } from "vue-router";

const whiteList = ["Setup", "Login", "Binding", "ResetPassword"];
const whiteList = ["Setup", "Login", "Binding", "ResetPassword", "Redirect"];

export function setupAuthCheckGuard(router: Router) {
router.beforeEach((to, from, next) => {
Expand Down Expand Up @@ -52,7 +52,7 @@ export function setupAuthCheckGuard(router: Router) {
return;
}

if (to.name === "whiteList") {
if (to.name && whiteList.includes(to.name as string)) {
next();
return;
}
Expand Down

0 comments on commit ec4c390

Please sign in to comment.