Open sameer-gits opened 6 months ago
The issue is KeyLookup: "header:session_name",
. This tells goth_fiber that you want it to look up the current session via a header, BUT crucially this applies to the callback too. So if you set KeyLookup
to header, and you point the OAuth callback to a function that calls goth_fiber.CompleteUserAuth
, that will throw this error.
The solution? You can either:
KeyLookup: cookie:session_name
CompleteUserAuth
. Make an API endpoint that calls CompleteUserAuth
that is separate from the OAuth callback. When the user comes to the OAuth callback page, you'll use JavaScript to call the endpoint with the correct header set.I switched to just using a cookie and that works fine.
Hello i think my code is ok but it throws err
2024/03/30 20:32:51 could not find a matching session for this request exit status 1
my repo link
main.go https://github.com/sameer-gits/go-fiber/blob/main/main.go
routes.go https://github.com/sameer-gits/go-fiber/blob/main/routes/routes.go