How would I return a Firebase custom token if the generation of the custom token is asynchronous?
问题 I'm using the Spark Framework hosted on Heroku and I have this in my main : method in my server post("/token", (request, response) -> "Hello World"); That's working fine, however, I want to actually send a custom token, and not just "Hello World". So, logically, I would need this: FirebaseAuth auth = FirebaseAuth.getInstance(); String uid = UUID.randomUUID().toString(); post("/token", (request, response) -> auth.createCustomToken(uid)); However, createCustomToken returns a Task<String> and