logout if no access to route

main
Joost Wooning 2021-09-14 12:37:04 +02:00
parent 2a0370aa58
commit ac71fa85c5
1 changed files with 6 additions and 3 deletions

View File

@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
import cx from 'classnames';
import { createWriteStream } from 'streamsaver';
import Panda from '@commaai/pandajs';
import CommaAuth from '@commaai/my-comma-auth';
import CommaAuth, { storage as CommaAuthStorage } from '@commaai/my-comma-auth';
import { raw as RawDataApi, drives as DrivesApi } from '@commaai/comma-api';
import { timeout, interval } from 'thyming';
import {
@ -237,8 +237,11 @@ export default class CanExplorer extends Component {
}));
})
.catch((err) => {
console.error(err);
this.showOnboarding();
console.log(err);
CommaAuthStorage.logOut().then(() => {
CommaAuthStorage.isAuthed = false;
this.showOnboarding();
});
});
} else {
this.showOnboarding();