trailblazer-endpoint icon indicating copy to clipboard operation
trailblazer-endpoint copied to clipboard

NoMethodError due to missing policy step

Open KonstantinKo opened this issue 8 years ago • 4 comments

When there is no policy step defined but an operation fails due to not being logged in at all, in the evaluation for the unauthenticated endpoint you get a NoMethodError: undefined method 'failure?' for nil:NilClass because result['result.policy.default'] is nil.

The comment # FIXME: we might need a &. here ;) in lib/trailblazer/endpoint.rb:22 seems to in fact be correct. But then again, the policy isn't always under the default namespace, is it?

KonstantinKo avatar Feb 15 '17 10:02 KonstantinKo

This is totally WIP and in fact I was hoping for someone clever like yourself to jump on this and make it bullet-proof.

Note: no &. though, haha! :joy:

apotonick avatar Feb 15 '17 15:02 apotonick

Well I don't know about making it completely "bullet-proof", but I sure as heck can shoot a few bullets into it 😉

KonstantinKo avatar Feb 15 '17 16:02 KonstantinKo

:pray:

apotonick avatar Feb 15 '17 16:02 apotonick

We need someone to use that piece of code and actually think about what makes sense. Will you be that rockstar?

apotonick avatar Feb 15 '17 16:02 apotonick