From 3baccffd365a6d8d1e990a15d0aace1f305e7ec9 Mon Sep 17 00:00:00 2001 From: Tom Russell Date: Thu, 13 Sep 2018 22:19:55 +0100 Subject: [PATCH] Redirect from edit if not logged in --- app/src/frontend/building-edit.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/frontend/building-edit.js b/app/src/frontend/building-edit.js index 4c1fc4bb..35dbd364 100644 --- a/app/src/frontend/building-edit.js +++ b/app/src/frontend/building-edit.js @@ -1,5 +1,5 @@ import React, { Component } from 'react'; -import { Link } from 'react-router-dom'; +import { Link, Redirect } from 'react-router-dom'; import ErrorBox from './error-box'; import InfoBox from './info-box'; @@ -87,6 +87,9 @@ class BuildingEdit extends Component { } render() { + if (!this.props.user){ + return + } if (!this.props.id){ return (