Skip to content

Commit

Permalink
Replace AppMetadata with JsonObject
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-tennert committed Nov 7, 2023
1 parent fb48051 commit d112a40
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 20 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import kotlinx.serialization.json.JsonObject
@Serializable
data class UserInfo(
@SerialName("app_metadata")
val appMetadata: AppMetadata,
val appMetadata: JsonObject? = null,
@SerialName("aud")
val aud: String,
@SerialName("confirmation_sent_at")
Expand Down
7 changes: 3 additions & 4 deletions GoTrue/src/commonTest/kotlin/GoTrueMock.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import io.github.jan.supabase.gotrue.providers.builtin.Email
import io.github.jan.supabase.gotrue.providers.builtin.Phone
import io.github.jan.supabase.gotrue.user.AppMetadata
import io.github.jan.supabase.gotrue.user.UserInfo
import io.github.jan.supabase.gotrue.user.UserSession
import io.ktor.client.engine.mock.MockEngine
Expand Down Expand Up @@ -101,9 +100,9 @@ class GoTrueMock {
val token = authorizationHeader.substringAfter("Bearer ")
if(token != VALID_ACCESS_TOKEN) return respondUnauthorized()
return when(request.method) {
HttpMethod.Get -> respond(UserInfo(AppMetadata("", listOf()), "", id = "userid"))
HttpMethod.Get -> respond(UserInfo(aud = "", id = "userid"))
HttpMethod.Put -> {
respond(UserInfo(AppMetadata("", listOf()), "", id = "userid", email = "[email protected]", emailChangeSentAt = Clock.System.now()))
respond(UserInfo(aud = "", id = "userid", email = "[email protected]", emailChangeSentAt = Clock.System.now()))
}
else -> return respondBadRequest("Invalid method")
}
Expand Down Expand Up @@ -179,7 +178,7 @@ class GoTrueMock {
"",
200,
"token_type",
UserInfo(aud = "", appMetadata = AppMetadata("", listOf()), id = "")
UserInfo(aud = "", id = "")
))

private fun MockRequestHandleScope.respondInternalError(message: String): HttpResponseData {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ kotlin.experimental.tryK2=false
org.jetbrains.compose.experimental.uikit.enabled=true
org.jetbrains.compose.experimental.jscanvas.enabled=true

supabase-version = 1.4.6
supabase-version = 1.4.7-dev-1

0 comments on commit d112a40

Please sign in to comment.