forked from remote/oauth2
google: update ApprovalForce to use updated value
This commit is contained in:
@@ -117,7 +117,7 @@ var (
|
|||||||
// ApprovalForce forces the users to view the consent dialog
|
// ApprovalForce forces the users to view the consent dialog
|
||||||
// and confirm the permissions request at the URL returned
|
// and confirm the permissions request at the URL returned
|
||||||
// from AuthCodeURL, even if they've already done so.
|
// from AuthCodeURL, even if they've already done so.
|
||||||
ApprovalForce AuthCodeOption = SetAuthURLParam("approval_prompt", "force")
|
ApprovalForce AuthCodeOption = SetAuthURLParam("prompt", "consent")
|
||||||
)
|
)
|
||||||
|
|
||||||
// An AuthCodeOption is passed to Config.AuthCodeURL.
|
// An AuthCodeOption is passed to Config.AuthCodeURL.
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ func newConf(url string) *Config {
|
|||||||
func TestAuthCodeURL(t *testing.T) {
|
func TestAuthCodeURL(t *testing.T) {
|
||||||
conf := newConf("server")
|
conf := newConf("server")
|
||||||
url := conf.AuthCodeURL("foo", AccessTypeOffline, ApprovalForce)
|
url := conf.AuthCodeURL("foo", AccessTypeOffline, ApprovalForce)
|
||||||
const want = "server/auth?access_type=offline&approval_prompt=force&client_id=CLIENT_ID&redirect_uri=REDIRECT_URL&response_type=code&scope=scope1+scope2&state=foo"
|
const want = "server/auth?access_type=offline&prompt=consent&client_id=CLIENT_ID&redirect_uri=REDIRECT_URL&response_type=code&scope=scope1+scope2&state=foo"
|
||||||
if got := url; got != want {
|
if got := url; got != want {
|
||||||
t.Errorf("got auth code URL = %q; want %q", got, want)
|
t.Errorf("got auth code URL = %q; want %q", got, want)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user