[auth] Change a Google OAuth parameter

Summary:
Some of our users who reauth are getting weird errors from Google — it seems that in some cases Google OAuth doesn’t pass us a `refresh_token`, even though we ask for one by passing `approval_prompt=force` (I’ve landed a commit to log more details about this in edgehill-server —- 6e984ffa26 — but this won’t fix the problem).

Apparently, Google recently « soft-deprecated » `approval_prompt` in favor of a new parameter called `prompt`, which does mostly the same thing (https://developers.google.com/identity/protocols/OAuth2WebServer#formingtheurl)

This diff replaces `approval_prompt` by `prompt`.

Test Plan: Tested by authing a Gmail account and checking that it worked.

Reviewers: bengotow

Reviewed By: bengotow

Subscribers: emfree

Differential Revision: https://phab.nylas.com/D2557
This commit is contained in:
Karim Hamidou 2016-02-19 11:20:36 -08:00
parent e5bf37cf9e
commit 3aa4b16b44

View file

@ -100,7 +100,7 @@ class AccountChoosePage extends React.Component
https://mail.google.com/ \
https://www.google.com/m8/feeds \
https://www.googleapis.com/auth/calendar'
approval_prompt: 'force'
prompt: 'consent'
})
{shell} = require 'electron'
shell.openExternal(googleUrl)