Permalink
Browse files

user, user-history: specify withCredentials with GET calls.

So we send the session cookie, which has the oauth2 authentication
token.
  • Loading branch information...
murraycu committed Sep 6, 2017
1 parent d645a90 commit b9d619e1d43fbacc2ece40b3609769047bc6f8ce
Showing with 3 additions and 3 deletions.
  1. +2 −2 src/app/rest-api-clients/user-history.service.ts
  2. +1 −1 src/app/rest-api-clients/user.service.ts
@@ -20,7 +20,7 @@ export class UserHistoryService {
getUserHistorySectionsForQuiz(quizId: string): Promise<UserHistorySections> {
// Note: We must use backticks: This is a template literal.
const url = `${Config.baseUrl}/api/user-history/${quizId}`;
return this.http.get(url)
return this.http.get(url, {withCredentials: true})
.toPromise()
.then(response => {
return UserHistoryService.jsonObjectToUserHistorySections(response.json());
@@ -33,7 +33,7 @@ export class UserHistoryService {
getUserHistoryForQuizzes(): Promise<UserHistoryQuizzes> {
// Note: We must use backticks: This is a template literal.
const url = `${Config.baseUrl}/api/user-history`;
return this.http.get(url)
return this.http.get(url, {withCredentials: true})
.toPromise()
.then(response => {
return UserHistoryService.jsonObjectToUserHistoryQuizzes(response.json());
@@ -18,7 +18,7 @@ export class UserService {
getUser(): Promise<LoginInfo> {
// Note: We must use backticks: This is a template literal.
const url = `${Config.baseUrl}/api/user`;
return this.http.get(url)
return this.http.get(url, {withCredentials: true})
.toPromise()
.then(response => {
return JsonUtils.jsonObjectToLoginInfo(response.json());

0 comments on commit b9d619e

Please sign in to comment.