https://kotlinlang.org logo
#ktor
Title
# ktor
j

Julius

05/10/2022, 12:07 PM
Hey! I'm trying to do the same thing as this stackoverflow post: https://stackoverflow.com/questions/71154171/is-there-any-way-to-drop-request-inside-plugin Meaning I want to reject a request inside a plugin (I want to implement verify firebase authentication https://firebase.google.com/docs/auth/admin/verify-id-tokens). The way described in the post doesn't work because of this error:
Cannot access 'pipeline': it is internal in 'PluginBuilder'
Is there a workaround for this or an overall better way to implement this?
r

Rustam Siniukov

05/10/2022, 12:25 PM
calling
call.respond
in your plugin handler should be enough
j

Julius

05/10/2022, 12:41 PM
Sounds very good! And that prevents the service logic from running?
Yes, this seems to be working! Can I cite you for answering the stackoverflow question @Rustam Siniukov?
r

Rustam Siniukov

05/10/2022, 1:03 PM
Sure!
u

U75957

10/31/2022, 5:54 PM
Why does the handler continue execution after
call.respond
? I expect it to work as
return
(even if it is used in a plugin). You have to call
return@get
or
return@onCall
But what's the point?
t

Trevor Stone

10/31/2022, 6:54 PM
I suspect it would be for instances where you might want to take an action/have the action continue doing something else after calling respond
3 Views