Skip to content

Commit 74efef9

Browse files
committed
feat: enhance logout logic to handle different user source types
1 parent 0c0f30c commit 74efef9

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

ui/src/api/type/user.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ interface User {
2929
language?: string
3030
workspace_list?: Array<any>
3131
role_name?: Array<any>
32+
source?: string
3233
}
3334

3435
interface LoginRequest {

ui/src/layout/layout-header/avatar/index.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,11 @@ const openResetPassword = () => {
188188
189189
const logout = () => {
190190
login.logout().then(() => {
191-
router.push({name: 'login', query: {login_mode: 'manual'}})
191+
if (user?.userInfo?.source && ['CAS', 'OIDC', 'OAuth2'].includes(user.userInfo.source)) {
192+
router.push({name: 'login', query: {login_mode: 'manual'}})
193+
} else {
194+
router.push({name: 'login'})
195+
}
192196
})
193197
}
194198

0 commit comments

Comments
 (0)