fix: Remove invalid session tokens + Login using the Return key
This commit is contained in:
@@ -44,6 +44,8 @@ export default class Application extends React.Component<IProps> {
|
||||
this.props.setUser(user);
|
||||
this.props.setAuthenticated(true);
|
||||
}).catch(err => {
|
||||
// The token is invalid, so we should remove it
|
||||
removeSessionToken(window);
|
||||
this.props.setAuthenticated(false);
|
||||
});
|
||||
}
|
||||
@@ -137,6 +139,7 @@ export default class Application extends React.Component<IProps> {
|
||||
}
|
||||
|
||||
getTopTenLearners = (): Promise<TopTen[]> => {
|
||||
// TODO: Deprecate?
|
||||
const id = this.props.user.classId;
|
||||
return new Promise((res, rej) => {
|
||||
fetch(`${BACKEND_URL}/api/class/${id}/topTen`, {
|
||||
|
||||
Reference in New Issue
Block a user