You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been exploring this today, and I've not come up with a simple drop-in solution unfortunately. The wrapper discourse uses works well, as long as you're guaranteed that the paths begin with '/auth'. I'll have to noodle on it a bit more when I get some more time.
OmniAuth::Builder was rebuilding its whole middleware stack, including every strategy, on every request, even ones that have nothing to do with authentication (#1083). That's fixed in c29ad9b: the stack is now built once and reused. It'll ship in the next release. If you still see a noticeable cost after upgrading, please open a new issue with a benchmark.
Activity
swrobel commentedon Apr 2, 2018
@schneems been a long time since you sent in your Hashie-memoization PR, but maybe you have some thoughts about this...?
BobbyMcWho commentedon Dec 8, 2020
I've been exploring this today, and I've not come up with a simple drop-in solution unfortunately. The wrapper discourse uses works well, as long as you're guaranteed that the paths begin with '/auth'. I'll have to noodle on it a bit more when I get some more time.
rainerborene commentedon Oct 9, 2023
Thanks @SamSaffron for bringing this up. I came up with a simpler solution using an initializer and monkey patch.
arpu commentedon Nov 11, 2023
@rainerborene how do i add this?
arpu commentedon Nov 11, 2023
ok looks like i can overwrite this in the config/initializers/omniauth.rb
any idea how i can enable the session only for the omniauth routes?
Build OmniAuth::Builder's middleware stack once
sferik commentedon Oct 20, 2026
OmniAuth::Builderwas rebuilding its whole middleware stack, including every strategy, on every request, even ones that have nothing to do with authentication (#1083). That's fixed in c29ad9b: the stack is now built once and reused. It'll ship in the next release. If you still see a noticeable cost after upgrading, please open a new issue with a benchmark.