mirror of
https://github.com/SomboChea/ui
synced 2024-11-24 06:54:27 +07:00
fix: remove token from AppState
This commit is contained in:
parent
6a421ab22d
commit
78b4c3fac1
@ -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,
|
||||||
|
Loading…
Reference in New Issue
Block a user