fix: sync remote authorization revoke logout

This commit is contained in:
iamxvbaba 2026-07-24 21:39:00 +08:00
parent b4aaf57d6b
commit 0dcfaf0a65
11 changed files with 216 additions and 142 deletions

View file

@ -12,6 +12,11 @@ import "github.com/iamxvbaba/td/tg"
func rpcAllowedWithoutAuthorization(id uint32) bool {
switch id {
case tg.AuthBindTempAuthKeyRequestTypeID,
// TWeb handles a 401 from a remotely revoked session by sending
// auth.logOut before it clears IndexedDB/local authorization state.
// This cleanup RPC is idempotent when no authorization remains; rejecting
// it with another 401 makes Web repeat its startup/logout cycle forever.
tg.AuthLogOutRequestTypeID,
tg.AuthExportLoginTokenRequestTypeID,
tg.AuthImportLoginTokenRequestTypeID,
tg.AuthAcceptLoginTokenRequestTypeID,