mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-13 00:45:44 +01:00
fix redirects on protected routes for anonymous user
This commit is contained in:
@@ -68,7 +68,7 @@ class App extends Component<Props> {
|
||||
content = <Loading />;
|
||||
} else if (error) {
|
||||
content = <ErrorPage title={t("app.error.title")} subtitle={t("app.error.subtitle")} error={error} />;
|
||||
} else {
|
||||
} else if (me) {
|
||||
content = <Main authenticated={authenticated} links={links} />;
|
||||
}
|
||||
return (
|
||||
|
||||
@@ -26,9 +26,9 @@ import { connect } from "react-redux";
|
||||
import { WithTranslation, withTranslation } from "react-i18next";
|
||||
import { Redirect } from "react-router-dom";
|
||||
|
||||
import { getLogoutFailure, isAuthenticated, isLogoutPending, isRedirecting, logout } from "../modules/auth";
|
||||
import { getLogoutFailure, isLogoutPending, isRedirecting, logout } from "../modules/auth";
|
||||
import { ErrorPage, Loading } from "@scm-manager/ui-components";
|
||||
import { getLogoutLink } from "../modules/indexResource";
|
||||
import { getLoginLink, getLogoutLink } from "../modules/indexResource";
|
||||
|
||||
type Props = WithTranslation & {
|
||||
authenticated: boolean;
|
||||
@@ -61,7 +61,7 @@ class Logout extends React.Component<Props> {
|
||||
}
|
||||
|
||||
const mapStateToProps = (state: any) => {
|
||||
const authenticated = isAuthenticated(state);
|
||||
const authenticated = state.auth.me && !getLoginLink(state);
|
||||
const loading = isLogoutPending(state);
|
||||
const redirecting = isRedirecting(state);
|
||||
const error = getLogoutFailure(state);
|
||||
|
||||
Reference in New Issue
Block a user