Closed Spazzy757 closed 1 year ago
I'd prefer to adding a new field Session
in App
to customize the session used by ParseCodeInfo
and similar methods.
type App struct {
// The session to send request when parsing tokens or code.
// If it's not set, default session will be used.
Session *Session
}
This would defintely work for my use case
Is this something you would like a PR on or would you like to tackle it?
Situation
Firstly thank you for adding the effort for creating this library.
I would like to use it for some facebook integrations we are creating however I notice that in the
App.ParseCodeInfo
is using the defaultSession to make requests. In my general use case we would want a way to overwrite the BaseURL for testing purposes.I would like to setup a fake server in testing and then run integration tests through my application that will test this functionality end to end (without reaching facebook for various reasons)
Potential Solutions
Maybe allowing the passing of a BaseURL or a Session into this function (either through the struct or through the a parameter) in order to allow this overwrite (I see you are able to overwrite the the BaseURL in the session struct). This would allow us to configure this accordingly