langsam ernährt sich das Eichhorn
This commit is contained in:
parent
38445559c2
commit
543fd56116
@ -31,8 +31,8 @@ class App extends Component {
|
|||||||
if (user) {
|
if (user) {
|
||||||
this.setState({
|
this.setState({
|
||||||
currentUser: user,
|
currentUser: user,
|
||||||
showModeratorBoard: user.roles.includes("ROLE_MODERATOR"),
|
//showModeratorBoard: user.roles.includes("ROLE_MODERATOR"),
|
||||||
showAdminBoard: user.roles.includes("ROLE_ADMIN")
|
//showAdminBoard: user.roles.includes("ROLE_ADMIN")
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -59,7 +59,7 @@ class Login extends Component {
|
|||||||
if (this.checkBtn.context._errors.length === 0) {
|
if (this.checkBtn.context._errors.length === 0) {
|
||||||
AuthService.login(this.state.username, this.state.password).then(
|
AuthService.login(this.state.username, this.state.password).then(
|
||||||
() => {
|
() => {
|
||||||
this.props.history.push("/profile");
|
this.props.navigate('/profile');
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
},
|
},
|
||||||
error => {
|
error => {
|
||||||
|
|||||||
@ -10,7 +10,7 @@ class AuthService {
|
|||||||
password
|
password
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
if (response.data.accessToken) {
|
if (response.data.token) {
|
||||||
localStorage.setItem('user', JSON.stringify(response.data));
|
localStorage.setItem('user', JSON.stringify(response.data));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user