sso修复
This commit is contained in:
1 parent
76b26a49a8
commit
d95ff27ee4
7 files changed
+104
-37
No files matched your search
@@ -7,6 +7,10 @@ import {
|
||||
isNativeApp,
|
||||
saveAuthSession,
|
||||
} from '../auth/session'
|
||||
import {
|
||||
clearNativeSsoLoginState,
|
||||
nativeSsoLoginState,
|
||||
} from '../services/nativeAppLinks'
|
||||
|
||||
export interface CurrentUser {
|
||||
id: string
|
||||
@@ -39,10 +43,12 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
const { data } = await http.post('/auth/sso/exchange', {
|
||||
code,
|
||||
isNativeApp: isNativeApp(),
|
||||
nativeState: nativeSsoLoginState(),
|
||||
})
|
||||
token.value = data.token
|
||||
user.value = data.user
|
||||
saveAuthSession(data)
|
||||
clearNativeSsoLoginState()
|
||||
}
|
||||
|
||||
async function bindSso(code: string, userName: string, password: string) {
|
||||
@@ -51,10 +57,12 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
userName,
|
||||
password,
|
||||
isNativeApp: isNativeApp(),
|
||||
nativeState: nativeSsoLoginState(),
|
||||
})
|
||||
token.value = data.token
|
||||
user.value = data.user
|
||||
saveAuthSession(data)
|
||||
clearNativeSsoLoginState()
|
||||
}
|
||||
|
||||
async function refresh() {
|
||||
|
||||
Reference in new issue
Block a user