Groups
Sign in
Groups
Roda
Conversations
Labels
About
Send feedback
Help
halt from before hook
13 views
Skip to first unread message
abhijit nandy
unread,
Sep 2, 2021, 2:06:27 AM
9/2/21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Roda
Hi,
I have included the
hook
and
halt
plugins.
I want to be able to halt a request with a status code on some condition.
For example -
before
do
unless
@user
response
.
status
=
401
# halt processing and return from here
# something like this
# return { :error => 'Invalid User'}
end
end
Any suggestions as to how I can achieve this?
Thanks,
- Abhijit.
abhijit nandy
unread,
Sep 2, 2021, 3:26:52 AM
9/2/21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Roda
Hi,
I managed to solve it with -
before
do
request.halt(401, 'Invalid User') unless @user
end
Reply all
Reply to author
Forward
0 new messages