Accept either old or new login requests during transition. (#1785)

* Accept either old or new login requests during transition.

* Made suggested edit

* Update api/login_api.py

Co-authored-by: Kyle Ju <kyleju@google.com>
This commit is contained in:
Jason Robbins 2022-03-14 16:30:50 -07:00 коммит произвёл GitHub
Родитель 9118ccc72c
Коммит b8582da8b0
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -28,8 +28,10 @@ class LoginAPI(basehandlers.APIHandler):
"""Create a session using the credential generated by Google Sign-In."""
def do_post(self):
token = self.get_param('credential')
message = "Unable to Authenticate"
# TODO(jrobbins): Remove id_token after next deployment.
token = (self.get_param('id_token', required=False) or
self.get_param('credential'))
message = "Unable to Authenticate. Please sign in again."
try:
idinfo = id_token.verify_oauth2_token(