1
0
mirror of https://github.com/SomboChea/ui synced 2024-11-28 00:44:30 +07:00

fix: remove token from AppState

This commit is contained in:
Griffithtp 2019-07-09 21:00:59 +01:00
parent 6a421ab22d
commit 78b4c3fac1

View File

@ -25,7 +25,6 @@ export interface AppStateInterface {
logoUrl: string; logoUrl: string;
user: { user: {
username?: string; username?: string;
token?: string;
}; };
scope: string; scope: string;
showLoginModal: boolean; showLoginModal: boolean;
@ -133,7 +132,7 @@ export default class App extends Component<{}, AppStateInterface> {
if (username && token) { if (username && token) {
storage.setItem('username', username); storage.setItem('username', username);
storage.setItem('token', token); storage.setItem('token', token);
this.setLoggedUser(username, token); this.setLoggedUser(username);
} }
if (error) { if (error) {
@ -144,7 +143,7 @@ export default class App extends Component<{}, AppStateInterface> {
} }
}; };
public setLoggedUser = (username, token) => { public setLoggedUser = username => {
this.setState({ this.setState({
user: { user: {
username, username,