🏡 index : ~doyle/chartered.git

author Jordan Doyle <jordan@doyle.la> 2021-11-11 18:59:06.0 +00:00:00
committer Jordan Doyle <jordan@doyle.la> 2021-11-11 18:59:06.0 +00:00:00
commit
ea28e31fa6a1937ae8fed789f13b819e224d77cf [patch]
tree
2166eb130e7a13f71c25e1e676caec641c6210cf
parent
1ed96c15d2cd0ca43360f779a39c4863e55e2034
download
ea28e31fa6a1937ae8fed789f13b819e224d77cf.tar.gz

When redirecting in rotues replace the current path so back works



Diff

 chartered-frontend/src/index.tsx | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/chartered-frontend/src/index.tsx b/chartered-frontend/src/index.tsx
index 0d755e4..ebcfc00 100644
--- a/chartered-frontend/src/index.tsx
+++ a/chartered-frontend/src/index.tsx
@@ -57,7 +57,7 @@
          <Route path="/login/oauth" element={<Public element={<HandleOAuthLogin />} />} />

          {/* Private routes, visible only to authenticated users */}
          <Route path="/" element={<Private element={<Navigate to="/dashboard" />} />} />
          <Route path="/" element={<Private element={<Navigate replace to="/dashboard" />} />} />
          <Route path="/dashboard" element={<Private element={<Dashboard />} />} />
          <Route path="/search" element={<Private element={<Search />} />} />

@@ -67,19 +67,19 @@

          <Route path="/users/:uuid" element={<Private element={<User />} />} />

          <Route path="/ssh-keys" element={<Private element={<Navigate to="/ssh-keys/list" />} />} />
          <Route path="/ssh-keys" element={<Private element={<Navigate replace to="/ssh-keys/list" />} />} />
          <Route path="/ssh-keys/list" element={<Private element={<ListSshKeys />} />} />
          <Route path="/ssh-keys/add" element={<Private element={<AddSshKeys />} />} />

          <Route path="/organisations" element={<Private element={<Navigate to="/organisations/list" />} />} />
          <Route path="/organisations" element={<Private element={<Navigate replace to="/organisations/list" />} />} />
          <Route path="/organisations/list" element={<Private element={<ListOrganisations />} />} />
          <Route path="/organisations/create" element={<Private element={<CreateOrganisation />} />} />

          <Route path="/sessions" element={<Private element={<Navigate to="/sessions/list" />} />} />
          <Route path="/sessions" element={<Private element={<Navigate replace to="/sessions/list" />} />} />
          <Route path="/sessions/list" element={<Private element={<ListSessions />} />} />

          <Route path="/404" element={<NotFound />} />
          <Route path="*" element={<Navigate to="/404" />} />
          <Route path="*" element={<Navigate replace to="/404" />} />
        </Routes>
      </Router>
    </ProvideAuth>