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

Skipping a scope of "openid connect" or "email" results in panic #39

Open mahadevans87 opened 1 year ago

mahadevans87 commented 1 year ago

I was trying to do google OAuth 2.0 login with the following scope -

    goth.UseProviders(
        gothGoogle.New(os.Getenv("OAUTH_KEY"), os.Getenv("OAUTH_SECRET"), "http://localhost:3000/auth/callback", "https://www.googleapis.com/auth/drive.metadata.readonly"),
    )

This results in goth crashing at gothv1,74.1/providers/google/session.go during authorize and token exchange - On line 44, goth assumes that an id_token is always returned. However, only if we add "email" or "open_id connect" in the scopes, we will get the scope. Otherwise, goth crashes because id_token is never returned.

image

If you are okay, I can submit a PR for this.

DeZeeKees commented 10 months ago

is there a way to fix this?

DeZeeKees commented 10 months ago

im running into the same problem