Hi all, how can I check whether the call `val deco...
# ktor
h
Hi all, how can I check whether the call
val decodedToken = FirebaseAuth.getInstance().verifyIdToken(session.id, true)
was called when using the session provider named
Session
. I tried to put a breakpoint at the code but the program didn't stop there. Thanks in advance
Copy code
install(Authentication) {
        session<FirebaseSession>("Session") {
            validate {
                session -> {
                    try {

                        val decodedToken = FirebaseAuth.getInstance().verifyIdToken(session.id, true)

                    } catch (firebaseException: FirebaseException) {

                        challenge {
                            call.respond(HttpStatusCode.Unauthorized)
                        }

                        throw firebaseException
                    }
                }
            }
        }
    }
a
Also, you can put there some code that logs messages about the session validation.
h
Hi again, I figured out that since I didn't return anything from the
try
block, the authentication handler have never succeeded
maybe we can update the documents to show this behaviour more apparently, or is it not how this function is intended to work, say the authentication handler should still work regardless of whether something is return from the
try
block?
a
I've created an issue to address this problem.
h
Thanks @Aleksei Tirman [JB]