Commit 4730250
committed
Fix Rails 8 lazy route loading breaking OmniAuth path matching
Rails 8 loads routes lazily, so Devise set_omniauth_path_prefix
(which runs during route generation) has not fired when OmniAuth
middleware processes the first request. The strategy falls back to
the default /auth prefix and misses /admin/auth/oidc, returning
Devise Authentication passthru 404.
Set OmniAuth.config.path_prefix eagerly in the engine initializer
after the devise.omniauth call (must be after, because that call
triggers autoload of devise/omniauth which nils the value).1 parent 1496bba commit 4730250
1 file changed
+9
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
90 | 99 | | |
91 | 100 | | |
92 | 101 | | |
| |||
0 commit comments