MiniProfiler icon indicating copy to clipboard operation
MiniProfiler copied to clipboard

Rack::MiniProfiler.authorize_request vs Rack::MiniProfiler.config.pre_authorize_cb

Open barmstrong opened this issue 12 years ago • 1 comments

I'm having a little trouble understanding the difference between these two.

Ideally, I'd like it to only show the miniprofiler if I call authorize_request. This seems to be the case in production. But in development it ignores authorize_request and obeys pre_authorize_cb so I have some duplicate logic in there.

Was just curious why the separate methods? Maybe there was some historical reason or another purpose I'm not aware of. Would it make sense to consolidate the two?

Thanks for the awesome gem. It's been a life saver.

barmstrong avatar Feb 08 '13 01:02 barmstrong

so sorry I have been so slack and have not replied.

main reason is that in pre_authorize you may not have enough information to authorize / deauthorize a client

If you want the behavior to be consistent with prd in dev try

Rack::MiniProfiler.config.authorization_mode = :whitelist

SamSaffron avatar Jul 30 '13 01:07 SamSaffron