diff --git a/frontend/src/components/app.tsx b/frontend/src/components/app.tsx index 7102fc8..3d1b3b3 100644 --- a/frontend/src/components/app.tsx +++ b/frontend/src/components/app.tsx @@ -22,9 +22,6 @@ import { makeAPICall } from "../api/call"; import { BACKEND_URL } from "../config.in"; import { TrackerEvent } from "../models/tracker"; -import { ILevel } from "../models/level"; -import { TopTen } from "../models/learner"; -import { IVocab } from "../models/vocab"; import { IReviewMetadata, ReviewType } from "../models/review"; import { IUser } from "../models/user"; import { IResponse } from "../models/server"; @@ -45,7 +42,7 @@ export default class Application extends React.Component { // TODO: When asking the server if our session is still valid, a spinner // should be shown const token = getSessionToken(window); - if (token !== null && !this.props.authenticated) { + if (token !== undefined && !this.props.authenticated) { this.checkAuthStatus(token).then(user => { this.props.setUser(user); this.props.setAuthenticated(true); @@ -62,7 +59,7 @@ export default class Application extends React.Component { trackAction(TrackerEvent.LOG_IN); return makeAPICall("/api/user/me", { - token: this.props.user.sessionToken, + token, method: "get", }) }