[O] Limit exposure of fields

This commit is contained in:
Azalea
2024-02-20 16:16:11 -05:00
parent 878a543818
commit 4b8385419e
3 changed files with 8 additions and 13 deletions

View File

@@ -133,19 +133,7 @@ class UserRegistrar(
}
@API("/me")
suspend fun getUser(@RP token: Str) = jwt.auth(token) { u ->
mapOf(
"username" to u.username,
"email" to u.email,
"lastLogin" to u.lastLogin,
"regTime" to u.regTime,
"profileLocation" to u.profileLocation,
"profileBio" to u.profileBio,
"emailConfirmed" to u.emailConfirmed,
"ghostCard" to u.ghostCard.luid,
"cards" to u.cards.map { it.luid },
)
}
suspend fun getUser(@RP token: Str) = jwt.auth(token)
@API("/setting")
suspend fun setting(@RP token: Str, @RP key: Str, @RP value: Str) = jwt.auth(token) { u ->