1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-08-08 22:46:33 +02:00

Refactor makeLoginURL to accept extraParams

And don't require the caller to know how to use the returned params.
This commit is contained in:
Alexander Block
2020-09-15 10:20:10 +02:00
parent 4eb9612679
commit 74918c40d8
4 changed files with 17 additions and 11 deletions

View File

@ -212,10 +212,10 @@ func (p *AzureProvider) GetEmailAddress(ctx context.Context, s *sessions.Session
}
func (p *AzureProvider) GetLoginURL(redirectURI, state string) string {
a, params := makeLoginURL(p.ProviderData, redirectURI, state)
extraParams := url.Values{}
if p.ProtectedResource != nil && p.ProtectedResource.String() != "" {
params.Add("resource", p.ProtectedResource.String())
extraParams.Add("resource", p.ProtectedResource.String())
}
a.RawQuery = params.Encode()
a := makeLoginURL(p.ProviderData, redirectURI, state, extraParams)
return a.String()
}