hanko icon indicating copy to clipboard operation
hanko copied to clipboard

Allow cookie name to be changed / configured

Open FlxMgdnz opened this issue 2 years ago • 2 comments

As requested in our community, it might help with adoption when it is possible to integrate Hanko completely transparent into an existing infrastructure.

FlxMgdnz avatar Sep 14 '22 18:09 FlxMgdnz

To make this work we would have to:

  • change the backend config to include a parameter for the cookie name https://github.com/teamhanko/hanko/blob/87a4003bae7d866d5a5b3674d4444705f331a604/backend/config/config.go#L162
  • return the cookie name in the PublicConfig so the frontend has access to it (https://github.com/teamhanko/hanko/blob/87a4003bae7d866d5a5b3674d4444705f331a604/backend/dto/config.go#L8)
  • Modify the frontend-sdk to use the given cookie name https://github.com/teamhanko/hanko/blob/ae510ad288f5a253b07dc9fedc3ed178517b7e34/frontend-sdk/src/lib/client/HttpClient.ts#L107

like-a-bause avatar Sep 15 '22 07:09 like-a-bause

We would also need to change it in the session middleware: https://github.com/teamhanko/hanko/blob/a6f677ad680bfc6796e159265d0c7cb9f9f32988/backend/server/middleware/session.go#L13

FreddyDevelop avatar Sep 15 '22 13:09 FreddyDevelop