Hey! I'm trying to do the same thing as this stack...
# ktor
j
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
calling
call.respond
in your plugin handler should be enough
j
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
Sure!
u
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
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