From 3f5f19f8961f0bbfe877f3f20257d99ed3e0b5ea Mon Sep 17 00:00:00 2001 From: Crossle Song Date: Thu, 16 Jun 2022 08:49:19 +0400 Subject: [PATCH] Fix typo --- library/src/main/kotlin/one/mixin/bot/SessionToken.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/library/src/main/kotlin/one/mixin/bot/SessionToken.kt b/library/src/main/kotlin/one/mixin/bot/SessionToken.kt index 36b5427..f9bc02b 100644 --- a/library/src/main/kotlin/one/mixin/bot/SessionToken.kt +++ b/library/src/main/kotlin/one/mixin/bot/SessionToken.kt @@ -2,7 +2,6 @@ package one.mixin.bot import net.i2p.crypto.eddsa.EdDSAPrivateKey import one.mixin.bot.extension.base64Encode -import one.mixin.bot.vo.User import java.security.Key import java.security.KeyPair @@ -20,12 +19,12 @@ sealed class SessionToken(open val userId: String, open val sessionId: String) { ) : SessionToken(userId, sessionId) } -fun getUserSessionToken(user: User, sessionKey: KeyPair, isRsa: Boolean = false): SessionToken { +fun getUserSessionToken(userId: String, sessionId: String, sessionKey: KeyPair, isRsa: Boolean = false): SessionToken { return if (isRsa) { - SessionToken.RSA(user.userId, user.sessionId, sessionKey.private) + SessionToken.RSA(userId, sessionId, sessionKey.private) } else { SessionToken.EdDSA( - user.userId, user.sessionId, + userId, sessionId, (sessionKey.private as EdDSAPrivateKey).seed.base64Encode() ) }