Skip to content

Commit bd75a3d

Browse files
authored
perf: cas auth (#3436)
1 parent 305cdea commit bd75a3d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

ui/src/router/chat/index.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ router.beforeEach(
4444
}
4545
const p_token = to.query.token
4646
if (p_token) {
47-
chatUser.setToken(p_token)
47+
chatUser.setToken(p_token as string)
4848
}
4949
const token = chatUser.getToken()
5050
if (authentication) {
@@ -75,7 +75,12 @@ router.beforeEach(
7575
}
7676
return
7777
}
78-
next()
78+
if (p_token) {
79+
next({ ...to, query: {} })
80+
} else {
81+
next()
82+
}
83+
7984
return
8085
}
8186
}

0 commit comments

Comments
 (0)