Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
crossle committed Jun 16, 2022
1 parent 57051de commit 3f5f19f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions library/src/main/kotlin/one/mixin/bot/SessionToken.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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()
)
}
Expand Down

0 comments on commit 3f5f19f

Please sign in to comment.