Redirect after login, help

Need help on how to build a redirect for a user so that after a successful sign-in, they are redirected from the login page to the dashboard. Github Copilot is telling me to use history.push but I’m just uncertain on how to proceed. I’m using Ioninc v5, with Firebase’s login with popup.

Am I on the the right path here or is there a better option?

          {/* Routes */}
          <Route path="/dashboard" component={DashboardPage} />
          <Route path="/login">
            <Login onSuccess={() => history.push("/dashboard")} />
          {/* Redirects */}
          <Redirect exact from="/" to="/login" />

: How do I ask a good question? - Help Center - Stack Overflow