I tried to store a result from an async Kotlin method to a variable.
Amplify.Auth.fetchAuthSession(
{result ->
Log.i(TAG, "Amplify: Fetch Auth Session $result")
isAuthenticated = result.isSignedIn
},
{error ->
Log.e(TAG , "Amplify: Fetch Auth Session $error")
}
)
if (isAuthenticated == true) {
[...]
I really don't know how to set the result.isSignedIn to the isAuthenticated variable, that I can use it outside of the closure. I found a similar question on stackoverflow, but it did not help me out.
May someone can help me?!