Shareed2k / goth_fiber

Package goth_fiber provides a simple, clean, and idiomatic way to write authentication packages for fiber framework applications.
MIT License
88 stars 14 forks source link

2024/03/30 20:32:51 could not find a matching session for this request exit status 1 #72

Open sameer-gits opened 6 months ago

sameer-gits commented 6 months ago

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

image

SeriousBug commented 6 days 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:

I switched to just using a cookie and that works fine.