Comments (8)
Thanks, glad I was not using Fold wrong
from cognito-idp.
I asked StackoverFlow and that answer doesn't work, there must be a way to return something useful
https://stackoverflow.com/questions/76101500/kotlin-returning-an-object-from-a-fold-closure/76103361#76103361
from cognito-idp.
This is more a question on Kotlin and how to work with suspend / Coroutines. But seeing the latest answer in this SO post I would infer that your problem is solved.
from cognito-idp.
Thank you Ben, I just assumed there was a way we could use onSuccess and onFailure
from cognito-idp.
Hi @Burf2k, there's indeed an issue with the fold extension. Since kotlin.Result couldn't get returned in the past and type information still gets lost when exported, we implemented our own Result type. Our fold extension doesn't return anything from onSuccess and onFailure.
from cognito-idp.
So do I need to use your library or wait for a fix?
from cognito-idp.
You could use getOrThrow to get the user, and wrap the call in a try/catch block to handle exceptions.
from cognito-idp.
Fold is just like a promise in the JS world, you could wrap the "callbacks" with suspendCancellableCoroutine
from cognito-idp.
Related Issues (20)
- Would this work for JS? HOT 4
- Implement targeted sign out HOT 1
- Unable to build project HOT 9
- Rename project HOT 9
- Swap result type HOT 5
- Unable to verify secret hash for client, when testing locally HOT 1
- Forgot Password request does not return failure with unknown username HOT 1
- ResendConfirmationCode missing in JS client
- Directly parse tokens
- Rerun test action on update of PR
- Test requests that rely on a confirmation code
- Vault token file requirements
- signIn fails because of unexpected JSON token `NewDeviceMetadata` HOT 1
- kotlinx.serialization.MissingFieldException: Field 'AuthenticationResult' is required for type with serial name HOT 3
- Expose `CUSTOM_AUTH` flow HOT 4
- Does not seem to work anymore HOT 2
- Calling a Lambda function HOT 2
- Can I delete user by email? HOT 3
- Any suggestions on where to store the tokens once they're retrieved? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cognito-idp.