Christopher Mederos
03/06/2025, 2:58 AMDavid Herman
03/06/2025, 3:03 AMDavid Herman
03/06/2025, 3:03 AMDavid Herman
03/06/2025, 3:04 AMDavid Herman
03/06/2025, 3:05 AMChristopher Mederos
03/06/2025, 3:09 AMChristopher Mederos
03/06/2025, 3:11 AMDavid Herman
03/06/2025, 3:18 AMDavid Herman
03/06/2025, 3:19 AMDavid Herman
03/06/2025, 3:20 AMChristopher Mederos
03/06/2025, 3:26 AM@Api
routes on the backend that mutate dataDavid Herman
03/06/2025, 3:30 AMrejectUnprivaligedUser
and adding code to the top of sensitive API endpoints like
if (ctx.rejectUnprivaligedUser()) return
is probably a Kobweb -idiomatic good first stepDavid Herman
03/06/2025, 3:31 AMctx.res
value to indicate an auth error codeChristopher Mederos
03/06/2025, 4:38 AMDavid Herman
03/06/2025, 4:52 AMChristopher Mederos
03/07/2025, 12:26 AMDavid Herman
03/07/2025, 1:01 AMwindow.fetch
(which doesn't provide such functionality as far as I'm aware)David Herman
03/07/2025, 1:01 AMDavid Herman
03/07/2025, 1:02 AMDavid Herman
03/07/2025, 1:03 AMDavid Herman
03/07/2025, 1:04 AMDavid Herman
03/07/2025, 1:05 AMDavid Herman
03/10/2025, 5:55 PMHeaders
default value here (set to null but you can override it): https://github.com/varabyte/kobweb/blob/982f18fdcdcfba62fb665764bb4832474c86fd12/f[…]ext/src/jsMain/kotlin/com/varabyte/kobweb/browser/http/Fetch.kt
In other words, somewhere in your code (@App
block probably), you can write:
FetchDefaults.Headers = mapOf(...)
If you do that, window.api
calls should automatically prepend the headers.Christopher Mederos
03/10/2025, 11:21 PM