[+] Wacca user/status/login

This commit is contained in:
Azalea
2024-03-28 03:37:14 -04:00
parent 39d62099df
commit 00c5edcea7
6 changed files with 71 additions and 28 deletions

View File

@@ -12,17 +12,6 @@ const val FTK = "test"
const val HOST = "http://localhost"
val ACCESS_CODE = "9900" + (1..16).map { Random.nextInt(0..9) }.joinToString("")
inline fun <reified T> String.json() = try {
JACKSON.readValue(this, T::class.java)
}
catch (e: Exception) {
println("Failed to parse JSON: $this")
throw e
}
fun String.jsonMap(): Map<String, Any?> = json()
fun String.jsonArray(): List<Map<String, Any?>> = json()
suspend fun registerUser(): Long {
val resp = HTTP.post(HOST.ensureEndingSlash() + "api/v2/frontier/register-card") {
parameter("ftk", FTK)