Skip to content

Commit

Permalink
Merge pull request #64 from walt-id/fix/algorand
Browse files Browse the repository at this point in the history
fixed duplicate code
  • Loading branch information
SuperBatata authored Aug 12, 2023
2 parents 81e5216 + b3b5bd0 commit 8d6fbae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/main/kotlin/id/walt/idp/nfts/NFTController.kt
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ object NFTController {
}

ChainEcosystem.ALGORAND -> {
address = SiwaManager.getAddress(message)
address = SiwaManager.getPublicKey(message)
val publicKey = SiwaManager.getPublicKey(message)
SiwaManager.verifySignature(session!!, message, publicKey,signature)
}
Expand Down
7 changes: 1 addition & 6 deletions src/main/kotlin/id/walt/idp/siwe/siwaManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,7 @@ object SiwaManager {



fun getAddress(message:String): String{
val regex = Regex("Public Key: ([A-Z0-9]+)\\s*\\.\\s*Date:")
val matchResult = regex.find(message)
val publicKey = matchResult?.groupValues?.get(1)
return publicKey!!
}


fun getNonce(message: String): String{
val nonce= message.split(".").last().split(":").last().trim()
Expand Down

0 comments on commit 8d6fbae

Please sign in to comment.