mirror of
https://github.com/matrix-org/sliding-sync.git
synced 2025-03-10 13:37:11 +00:00
Ensure invalidateTokenImmediately acquires mutex
This commit is contained in:
parent
0e8d4a8e47
commit
5e65210cc4
@ -99,8 +99,10 @@ func (s *testV2Server) addAccountWithDeviceID(userID, deviceID, token string) {
|
|||||||
|
|
||||||
// like invalidateToken, but doesn't do any waiting.
|
// like invalidateToken, but doesn't do any waiting.
|
||||||
func (s *testV2Server) invalidateTokenImmediately(token string) {
|
func (s *testV2Server) invalidateTokenImmediately(token string) {
|
||||||
|
s.mu.Lock()
|
||||||
delete(s.tokenToUser, token)
|
delete(s.tokenToUser, token)
|
||||||
delete(s.tokenToDevice, token)
|
delete(s.tokenToDevice, token)
|
||||||
|
s.mu.Unlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove the token and wait until the proxy sends a request with this token, then 401 it and return.
|
// remove the token and wait until the proxy sends a request with this token, then 401 it and return.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user