From f6e6b1edbbb68bf6bf93a10deebd4cd55ffaff0f Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 5 Mar 2021 23:33:50 +0100 Subject: use other login validator thingie --- animism-align/frontend/app/views/auth/auth.gate.js | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'animism-align/frontend/app/views/auth/auth.gate.js') diff --git a/animism-align/frontend/app/views/auth/auth.gate.js b/animism-align/frontend/app/views/auth/auth.gate.js index ba69256..36d4af8 100644 --- a/animism-align/frontend/app/views/auth/auth.gate.js +++ b/animism-align/frontend/app/views/auth/auth.gate.js @@ -14,23 +14,14 @@ class AuthGate extends Component { } componentDidUpdate(prevProps) { - if (this.props.user_id !== prevProps.user_id) { + if (this.props.user.id !== prevProps.user.id) { this.load() } } load() { - if (!this.props.user_id) return - actions.user.show(this.props.user_id) - .then(() => { - actions.site.loadProject() - }).catch(error => { - if (error.status_code === 401) { - actions.auth.logout() - } else { - console.error(error) - } - }) + if (!this.props.user.id) return + actions.site.loadProject() } render() { -- cgit v1.2.3-70-g09d2