hydra icon indicating copy to clipboard operation
hydra copied to clipboard

server.injectConsentManager doesn't use ConsentRequestSQLManager even if *config.SQLConnection exists

Open dragon3 opened this issue 9 years ago • 5 comments

When I was running multiple instances of hydra under reverse proxy server, often failed to get consent request with 404 error, then I found this issue.

Could you please the following diff? Is it a correct patch to fix the issue?

diff --git a/cmd/server/handler_consent_factory.go b/cmd/server/handler_consent_factory.go
index 17d0a2d..85dbe58 100644
--- a/cmd/server/handler_consent_factory.go
+++ b/cmd/server/handler_consent_factory.go
@@ -16,7 +16,7 @@ func injectConsentManager(c *config.Config) {
                manager = oauth2.NewConsentRequestMemoryManager()
                break
        case *config.SQLConnection:
-               manager = oauth2.NewConsentRequestMemoryManager()
+               manager = oauth2.NewConsentRequestSQLManager(con.GetDatabase())
                break
        case *config.PluginConnection:
                var err error

Thank you!

dragon3 avatar Oct 18 '17 02:10 dragon3

Whoops, what a blunder! Would you mind creating a PR? :)

aeneasr avatar Oct 18 '17 07:10 aeneasr

I fired up a quick pr myself: #618

aeneasr avatar Oct 18 '17 08:10 aeneasr

@arekkas Thanks! Are you going to release 0.10.0-alpha.8 with this fix soon?

dragon3 avatar Oct 18 '17 17:10 dragon3

Yep, totally forgot about that one.

aeneasr avatar Oct 18 '17 17:10 aeneasr

https://github.com/ory/hydra/releases/tag/v0.10.0-alpha.8

buildchain will take a while (~30min) as always

aeneasr avatar Oct 18 '17 17:10 aeneasr