goth icon indicating copy to clipboard operation
goth copied to clipboard

Not Working with the gin framework

Open SyedMuzamilM opened this issue 4 years ago • 3 comments

This lib is not working with golang. It is showing you must select a provider. But I am providing a provider....

SyedMuzamilM avatar Jul 19 '21 14:07 SyedMuzamilM

I was able to modify the example to work correctly on Gin. I suspect you're just not getting the provider parameter correctly. You'll probably need to post code for help spotting why.

mackrorysd avatar Jul 28 '21 13:07 mackrorysd

@SyedMuzamilM you can do it like so

q := context.Request.URL.Query()
q.Add("provider", context.Param("provider"))
context.Request.URL.RawQuery = q.Encode()
gothic.BeginAuthHandler(context.Writer, context.Request)

but i agree, its not clear without example

vborovok avatar Aug 02 '21 13:08 vborovok

You can also add it with the GetProviderName function before the CompleteUserAuth call like so, provided your url param is :provider

gothic.GetProviderName = func(r *http.Request) (string, error) { return c.Param("provider"), nil }

coehne avatar Sep 22 '22 12:09 coehne