Skip to content

Commit 62cf81f

Browse files
committed
Replaced Plus API in optional example
1 parent 691f184 commit 62cf81f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

optional-kubernetes-engine/bookshelf/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,14 @@ def get_model():
108108

109109
def _request_user_info(credentials):
110110
"""
111-
Makes an HTTP request to the Google+ API to retrieve the user's basic
111+
Makes an HTTP request to the Google OAuth2 API to retrieve the user's basic
112112
profile information, including full name and photo, and stores it in the
113113
Flask session.
114114
"""
115115
http = httplib2.Http()
116116
credentials.authorize(http)
117117
resp, content = http.request(
118-
'https://www.googleapis.com/plus/v1/people/me')
118+
'https://www.googleapis.com/oauth2/v3/userinfo')
119119

120120
if resp.status != 200:
121121
current_app.logger.error(

optional-kubernetes-engine/bookshelf/crud.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ def add():
9090

9191
# If the user is logged in, associate their profile with the new book.
9292
if 'profile' in session:
93-
data['createdBy'] = session['profile']['displayName']
94-
data['createdById'] = session['profile']['id']
93+
data['createdBy'] = session['profile']['name']
94+
data['createdById'] = session['profile']['email']
9595

9696
book = get_model().create(data)
9797

0 commit comments

Comments
 (0)