优化
This commit is contained in:
@@ -108,11 +108,11 @@ test('refresh replacement validates the unified token before atomically changing
|
||||
assert.equal(session.refreshToken, 'refresh-43')
|
||||
})
|
||||
|
||||
test('refresh cannot carry an old operation into another user or warehouse', () => {
|
||||
test('refresh cannot carry an old operation into another user, membership, tenant or warehouse', () => {
|
||||
storage(); signOut(); signInWithTokens(tokenPair())
|
||||
const original = session.token
|
||||
for (const domestic of [{ user_id: 99 }, { overseas_warehouse_id: 901 }]) {
|
||||
assert.throws(() => replaceTokens(tokenPair({ domestic })), /主体或绑定仓库已变更/)
|
||||
for (const domestic of [{ user_id: 99 }, { membership_id: 85 }, { tenant_id: 1 }, { overseas_warehouse_id: 901 }]) {
|
||||
assert.throws(() => replaceTokens(tokenPair({ domestic })), /主体或绑定仓库已变更|不属于平台仓库作业端/)
|
||||
assert.equal(session.token, original)
|
||||
assert.equal(session.currentUser.warehouseId, '900')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user