fix(pda): revoke expired sessions before completing logout
This commit is contained in:
@@ -57,11 +57,14 @@ test('confirmed session expiry clears sensitive state and redirects only once',
|
||||
assert.match(http, /if \(isUnauthorized\(error\)\) return expireSession/)
|
||||
})
|
||||
|
||||
test('manual logout revokes the refresh token without delaying local cleanup', async () => {
|
||||
const [profile, auth] = await Promise.all([read('../pages/profile/profile.vue'), read('../api/auth.js')])
|
||||
assert.match(auth, /export function logout\(refreshToken, accessToken\)/)
|
||||
assert.match(profile, /const refreshToken = session\.refreshToken[\s\S]*?const accessToken = session\.token[\s\S]*?signOut\(\)[\s\S]*?uni\.reLaunch/)
|
||||
assert.match(profile, /logoutRequest\(refreshToken, accessToken\)\.catch/)
|
||||
test('manual logout waits for captured-session revoke and honestly handles failure', async () => {
|
||||
const [profile, helper] = await Promise.all([read('../pages/profile/profile.vue'), read('../api/logout-session.js')])
|
||||
assert.match(profile, /logoutCurrentSession\(\)/)
|
||||
assert.match(profile, /operation\.then/)
|
||||
assert.match(profile, /服务端退出未确认/)
|
||||
assert.match(helper, /signOut\(\)/)
|
||||
assert.match(helper, /error\.statusCode !== 401/)
|
||||
assert.doesNotMatch(profile, /catch\(\(\) => \{\}\)/)
|
||||
})
|
||||
|
||||
test('production login starts empty and remembers only the account preference', async () => {
|
||||
|
||||
Reference in New Issue
Block a user