https://kotlinlang.org logo
#react
Title
# react
m

moltendorf

07/05/2022, 8:36 AM
Just wanted to ask this here before I request support over at Auth0; hopefully I'm not just doing something wrong (using kotlin wrapping their sdk) because a lot of their documentation seems to imply this just works but my result is anything I pass in for "opts" ends up as "queryParam_1" (adding _1 to the end and ultimately not affecting any behavior whether it was supposed to generate a url or not): no matter what method I call; logout, loginWithRedirect, etc. I've ultimately defined the function as so
Copy code
external interface Auth0ContextInterface : AuthState {
  fun logout(options: Object? = definedExternally): Void
}
and I call it like so:
auth0.logout(object { val localOnly = true })
only it (unlike the documentation implies) adds localOnly_1 to the url and redirects me (whereas that option should not perform anything with urls) https://auth0.github.io/auth0-react/interfaces/Auth0ContextInterface.html#logout
Solution inside
t

turansky

07/05/2022, 9:24 AM
jso
factory is preferred. Example
b

Big Chungus

07/05/2022, 9:26 AM
We'll it's the same end result. Jso just saves you the trouble if having to write those couple of lines yourself
t

turansky

07/05/2022, 9:28 AM
It’s also strict DSL for now and potentially compiler checks in future
b

Big Chungus

07/05/2022, 9:30 AM
Strict dsl can be replicated with extra 2 limeas and compiler checks are unlikely as this is not part of stdlib. In short, I don't see any reason to bring in an entire dependency for a single function alone
t

turansky

07/05/2022, 9:32 AM
and compiler checks are unlikely as this is not part of stdlib
I’m talking about custom compiler plugin 🙂
👍 1
m

moltendorf

07/06/2022, 2:45 AM
Thank you so much; sorry for taking a while to get back! I got it working with the first comment though I'm always excited to try out better options! It's not just one function it's actually all of them perhaps so the library would be useful I just found a workaround for all the other functions not behaving until I couldn't find any option that worked because logout was the "only way" to actually clear the session locally in the sdk from what I could tell.
4 Views