feat(auth): 重构统一认证并支持平级服务无感登录
This commit is contained in:
1 parent
d79def5519
commit
ca312ea751
64 files changed
+3713
-449
No files matched your search
@@ -12,6 +12,7 @@ import { useAuthStore } from '@/features/auth/stores/auth.store';
|
||||
import loginBg from '@/assets/login-bg.png';
|
||||
import { DEFAULT_POST_LOGIN_AGENT_ID } from '@/features/workspace/types/workspace.types';
|
||||
import { useWorkspaceLocale } from '@/features/workspace/composables/useWorkspaceLocale';
|
||||
import { continuationLocation, readSsoContinuation } from '@/features/sso';
|
||||
import { useLoginAuth } from './useLoginAuth';
|
||||
import { useLoginLanding } from './useLoginLanding';
|
||||
|
||||
@@ -28,11 +29,21 @@ export function useLogin() {
|
||||
|
||||
const completePasswordLogin = async () => {
|
||||
authStore.syncFromStorage();
|
||||
const continuation = readSsoContinuation();
|
||||
if (continuation) {
|
||||
await router.replace(continuationLocation(continuation));
|
||||
return;
|
||||
}
|
||||
await router.replace(`/chat/${DEFAULT_POST_LOGIN_AGENT_ID}`);
|
||||
};
|
||||
|
||||
const completeOAuthLogin = async () => {
|
||||
authStore.syncFromStorage();
|
||||
const continuation = readSsoContinuation();
|
||||
if (continuation) {
|
||||
await router.replace(continuationLocation(continuation));
|
||||
return;
|
||||
}
|
||||
await router.replace('/workspace/applications');
|
||||
};
|
||||
|
||||
@@ -58,7 +69,8 @@ export function useLogin() {
|
||||
|
||||
authStore.syncFromStorage();
|
||||
if (authStore.isLoggedIn) {
|
||||
await router.replace('/workspace/applications');
|
||||
const continuation = readSsoContinuation();
|
||||
await router.replace(continuation ? continuationLocation(continuation) : '/workspace/applications');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user