mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-05 23:50:08 +08:00
[core] Fix token not saving after refresh token (#2590)
This commit is contained in:
parent
3b8534468d
commit
0f1bddcb24
@ -67,5 +67,8 @@ internal class KeyRefreshProcessorImpl(
|
||||
|
||||
override suspend fun refreshKeysNow(handler: NetworkHandler) {
|
||||
handler.sendAndExpect(WtLogin15(handler.context[SsoProcessor].client))
|
||||
handler.context[SsoProcessor].client.bot.apply {
|
||||
components[AccountSecretsManager].saveSecrets(account, AccountSecretsImpl(client))
|
||||
}
|
||||
}
|
||||
}
|
@ -12,6 +12,8 @@ package net.mamoe.mirai.internal.network.protocol.packet.chat.receive
|
||||
import io.ktor.utils.io.core.*
|
||||
import net.mamoe.mirai.internal.QQAndroidBot
|
||||
import net.mamoe.mirai.internal.network.Packet
|
||||
import net.mamoe.mirai.internal.network.components.AccountSecretsImpl
|
||||
import net.mamoe.mirai.internal.network.components.AccountSecretsManager
|
||||
import net.mamoe.mirai.internal.network.protocol.packet.IncomingPacketFactory
|
||||
import net.mamoe.mirai.internal.network.protocol.packet.OutgoingPacket
|
||||
import net.mamoe.mirai.internal.network.protocol.packet.buildResponseUniPacket
|
||||
@ -23,6 +25,7 @@ internal object OnlinePushSidExpired :
|
||||
override suspend fun QQAndroidBot.handle(packet: Packet?, sequenceId: Int): OutgoingPacket {
|
||||
return buildResponseUniPacket(client, sequenceId = sequenceId).also {
|
||||
bot.network.sendAndExpect(WtLogin10(client, mainSigMap = 1052896, remark = "10:refresh-token"))
|
||||
bot.components[AccountSecretsManager].saveSecrets(bot.account, AccountSecretsImpl(client))
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user