From b50da5917654afcfc20ff71658505b5826870423 Mon Sep 17 00:00:00 2001
From: Jules Laplace <jules@okfoc.us>
Date: Mon, 20 Mar 2017 04:54:05 +0100
Subject: log in and out without reloading

---
 client/components/LoggedOutView.jsx | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

(limited to 'client/components/LoggedOutView.jsx')

diff --git a/client/components/LoggedOutView.jsx b/client/components/LoggedOutView.jsx
index b176edb..8d69896 100644
--- a/client/components/LoggedOutView.jsx
+++ b/client/components/LoggedOutView.jsx
@@ -24,6 +24,7 @@ export default class LoggedOutView extends React.Component {
       return (
         <LoginForm
           visible={true}
+          didAuthenticate={this.props.didAuthenticate}
           onClose={this.closeModal} />
       )
     }
@@ -31,6 +32,7 @@ export default class LoggedOutView extends React.Component {
       return (
         <SignupForm
           visible={true}
+          didAuthenticate={this.props.didAuthenticate}
           onClose={this.closeModal} />
       )
     }
@@ -87,7 +89,7 @@ class LoginForm extends React.Component {
       password: this.state.password,
     }).then(res => {
       console.log('Authenticated!', res);
-      window.location.reload()
+      this.props.didAuthenticate(res.data)
     }).catch(error => {
       console.error('Error authenticating!', error);
       this.setState({
@@ -152,7 +154,7 @@ class SignupForm extends React.Component {
       })
     }).then(res => {
       console.log('Authenticated!', res)
-      window.location.reload()
+      this.props.didAuthenticate(res.data)
     }).catch(error => {
       console.error('Error authenticating!', error)
       this.setState({
-- 
cgit v1.2.3-70-g09d2

